Z
Zenon
I am having trouble with a simple filter, hope someone can help. I
have a form based on a query. I am trying to filter the form's output
by the text of a textbox. The event is a command button. Here is my
attempts at the code, none of which worked
Private Sub btn_Filter_Description_Click()
Me.Description.SetFocus
If (IsNull(Me.Description) Or Me.Description.Text = "") Then
MsgBox ("Cannot filter by blank value")
Else
Dim stmt As String
Dim arg As String
Me.Description.SetFocus
'stmt = Me.Description.Text
arg = Forms![form_Incoming].Description.Text
stmt = BuildCriteria("Description", dbText, arg)
Me.Filter = stmt
'Me.Description.SetFocus
'Me.Form.Filter = "Description.Text = " & stmt
'Me.Form.FilterOn = True
End If
End Sub
thanks,
Zenon
have a form based on a query. I am trying to filter the form's output
by the text of a textbox. The event is a command button. Here is my
attempts at the code, none of which worked
Private Sub btn_Filter_Description_Click()
Me.Description.SetFocus
If (IsNull(Me.Description) Or Me.Description.Text = "") Then
MsgBox ("Cannot filter by blank value")
Else
Dim stmt As String
Dim arg As String
Me.Description.SetFocus
'stmt = Me.Description.Text
arg = Forms![form_Incoming].Description.Text
stmt = BuildCriteria("Description", dbText, arg)
Me.Filter = stmt
'Me.Description.SetFocus
'Me.Form.Filter = "Description.Text = " & stmt
'Me.Form.FilterOn = True
End If
End Sub
thanks,
Zenon