To make sure the button is connected to the code, try this:
Code:
Private Sub SearchContacts_Click()
msgbox "text search is" & Me.txtSearch
End Sub
If the message box is displayed, try:
Code:
Private Sub SearchContacts_Click()
msgbox "[ddCategory] like '*" & Me.txtSearch & "*'"
End Sub
Next, try:
Code:
Private Sub SearchContacts_Click()
DoCmd.OpenReport "Contacts", acViewPreview
End Sub
Then try:
Code:
Private Sub SearchContacts_Click()
dim strCriteria as string
strCriteria = "[ddCategory] like '*" & Me.txtSearch & "*'"
DoCmd.OpenReport "Contacts", acViewPreview, , strCriteria
End Sub