chaostheory
Registered User.
- Local time
- Today, 07:02
- Joined
- Sep 30, 2008
- Messages
- 69
I have a form created. It displays all the records in the table.
In the Form header i put a text box (txtSearch) with a button(btnFilter) next to it.
People can type in the text box, then click the button to apply the filter
Thats what i want to happen.
Here is the button click code. Needless to say it don't work, and its giving me a popup box asking me for the criteria instead of using the txtSearch text box i have next to it. [Skid] is the name of the field i want the filter based on.
So you type 012345 in the text box i want every record with that in the Skid field to show up.
Help is appreciated, thanks in advance!
In the Form header i put a text box (txtSearch) with a button(btnFilter) next to it.
People can type in the text box, then click the button to apply the filter
Thats what i want to happen.
Here is the button click code. Needless to say it don't work, and its giving me a popup box asking me for the criteria instead of using the txtSearch text box i have next to it. [Skid] is the name of the field i want the filter based on.
So you type 012345 in the text box i want every record with that in the Skid field to show up.
Help is appreciated, thanks in advance!
Code:
Private Sub btnFilter_Click()
If Len(txtSearch) = 0 Or IsNull(txtSearch) = True Then
MsgBox "You must enter a Skid ID to search."
Else
'Filter frmCharacterization based on search criteria
Me.Filter = "[Skid] LIKE " & txtSearch.Value
Me.FilterOn = True
'Close frmCharacterization
MsgBox "Results have been filtered."
End If
End Sub
Last edited: