A
Afrosheen via AccessMonster.com
I found a program on this board that will find a person by last name. Here is
the code:
Private Sub txtFind_AfterUpdate()
10 On Error GoTo txtFind_AfterUpdate_Error
20 If Len(txtFind) > 0 Then
30 Me.Filter = "[lname] Like ""*" & txtFind & "*"""
40 Me.FilterOn = True
50 Else
60 Me.FilterOn = False
70 End If
80 On Error GoTo 0
90 Exit Sub
txtFind_AfterUpdate_Error:
100 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure txtFind_AfterUpdate of VBA Document Form_frmEmployee_Tab"
End Sub
It works great when it's on the main form. It displays the information I need.
I have created a subform with the same code. The problem is that when I put
in the last name to "search" on the subform, it doesn't show a match on the
main form which I want it to do.
Any help would be appreciated. I thank you for reading my post. Everyone has
been a great help.
the code:
Private Sub txtFind_AfterUpdate()
10 On Error GoTo txtFind_AfterUpdate_Error
20 If Len(txtFind) > 0 Then
30 Me.Filter = "[lname] Like ""*" & txtFind & "*"""
40 Me.FilterOn = True
50 Else
60 Me.FilterOn = False
70 End If
80 On Error GoTo 0
90 Exit Sub
txtFind_AfterUpdate_Error:
100 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure txtFind_AfterUpdate of VBA Document Form_frmEmployee_Tab"
End Sub
It works great when it's on the main form. It displays the information I need.
I have created a subform with the same code. The problem is that when I put
in the last name to "search" on the subform, it doesn't show a match on the
main form which I want it to do.
Any help would be appreciated. I thank you for reading my post. Everyone has
been a great help.