desjardins
Registered User.
- Local time
- Today, 09:35
- Joined
- Dec 21, 2010
- Messages
- 13
I have a main form, frm_search, based on a table, tbl_people. The main form has a subform, sfrm_people. All I want to do is have the user type all or part of the person's last name on the main form, and have a list of ALL people with the matching string in the subform. i.e. If there are two people named Smith, they will both appear ON THE SAME DATASHEET. Or if the user types in son, Anderson and Robertson both appear. Currently I have to use record navigation on the main form to get from Jane Smith to Bob Smith. The forms are linked by PersonID.
I have tried this:
Private Sub command7_click()
Dim strfilter As String
If Me.Text8 = "" Then
Me.FilterOn = False
Me.Text8.SetFocus
Exit Sub
End If
strfilter = "LastName Like '*' & '" & Me.Text8 & "' & '*'"
Me.Filter = strfilter
Me.FilterOn = True
End Sub
I tried replacing me.filter with me.sfrm_people.form.filter but then it returns no results at all. Please post the code here, I cannot download files at work.
Thanks in advance!
I have tried this:
Private Sub command7_click()
Dim strfilter As String
If Me.Text8 = "" Then
Me.FilterOn = False
Me.Text8.SetFocus
Exit Sub
End If
strfilter = "LastName Like '*' & '" & Me.Text8 & "' & '*'"
Me.Filter = strfilter
Me.FilterOn = True
End Sub
I tried replacing me.filter with me.sfrm_people.form.filter but then it returns no results at all. Please post the code here, I cannot download files at work.
Thanks in advance!