I am working on a database to keep track of the computers in my company. I have a form that shows all the fields in the table. I can edit them delete them insert new ones. All that works fine on the form. I can also search using the built in search function but I dont really like it. So in the header section of my form I have an unbound textbox and two buttons one is filter the other is clear.
Code:
Private Sub cmdFilter_Click()
Dim strWhere As String
If Len(Me.txtSearch & vbNullString) > 0 Then
strWhere = "([Location] Like """ & Me.txtSearch & "*"")"
End If
Me.Filter = strWhere
Me.FilterOn = True
Me.Requery
End Sub
This works fine I can type in a city name or part of it and it will filter the form to only show computers in our office in that city. However I want it to be able to filter anything. Say I know a serial number or I just want to see how many Dell pc's we have in our company I want to be able to type what ever information I know into that box and click filter and it show me the matches. Can someone please help me modify my code to allow for this. Thanks