I used the following code !! The only problem I have is, that this cod
is applied to a subform. When I open the subform and run the code i
works
As soon as I open the mainform and try to run it in there it does no
work anymore.
Can anyone help
Private Sub Command135_Click()
Dim szLastName As String, szCrit As String
''' Retrieve user entered search criteria
Me.Combo136.SetFocus
szLastName = Me.Combo136.Text
''' Determine if user entered criteria
If Len(szLastName) < 1 Then
MsgBox "You must first enter a last name to search on."
Cancel = True
Else
''' Build criteria
Me.MBS_Nr.SetFocus
szCrit = BuildCriteria(MBS_Nr, dbText, szLastName)
''' Apply the filter to the form
DoCmd.ApplyFilter , szCrit
End If
End Su