c02dm
Registered User.
- Local time
- Today, 21:57
- Joined
- Apr 12, 2005
- Messages
- 18
Hi,
I'm trying to search for a last name, but if the name can't be found i want it to return a message box saying "There are no customers with that name". I've tried using an if statement but it seems to run past the code for the filter and just display the message box each time even if the customer is in the table or not. Can anyone please help. Here is my code to implement the filter.
Private Sub cmdFilterByName_Click()
Dim strName As String
Dim strFilter As String
strName = txtLastName & "*"
strFilter = "[LastName] like '" & strName & "'"
DoCmd.ApplyFilter , strFilter
End Sub
Thanks in advance.
Dan
I'm trying to search for a last name, but if the name can't be found i want it to return a message box saying "There are no customers with that name". I've tried using an if statement but it seems to run past the code for the filter and just display the message box each time even if the customer is in the table or not. Can anyone please help. Here is my code to implement the filter.
Private Sub cmdFilterByName_Click()
Dim strName As String
Dim strFilter As String
strName = txtLastName & "*"
strFilter = "[LastName] like '" & strName & "'"
DoCmd.ApplyFilter , strFilter
End Sub
Thanks in advance.
Dan