Article ID: 178198
Article Last Modified on 1/22/2007
strFilter = BuildCriteria("Product Name", dbText, strInput)
strFilter = BuildCriteria("[Product Name]", dbText, strInput)
'******************************************************************
' This procedure opens a form and applies a filter.
'******************************************************************
Sub SetFilter()
Dim frm As Form, strMsg As String
Dim strInput As String, strFilter As String
' Open Products form in Form view.
DoCmd.OpenForm "Products"
' Return Form object variable pointing to Products form.
Set frm = Forms!Products
strMsg = "Enter one or more letters of product name " & _
"followed by an asterisk."
' Prompt user for input.
strInput = InputBox(strMsg)
' Build criteria string.
strFilter = BuildCriteria("Product Name", dbText, strInput)
' Set Filter property to apply filter.
frm.Filter = strFilter
' Set FilterOn property; form now shows filtered records.
frm.FilterOn = True
End Sub
Additional query words: error searching filtering run time error 2448 you can t assign a value to this object
Keywords: kberrmsg kbprb KB178198