filtering subform with listbox from main form

icemonster

Registered User.
Local time
Today, 09:31
Joined
Jan 30, 2010
Messages
502
so i have a form with a subform, how do i filter the record using a listbox?

i tried doing this

Code:
Private Sub lstClientList_Click()
DoCmd.Requery
Forms.[navfrmClient].[NavigationSubform].RecordsetClone.FindFirst "[ClientID] = " & Me![lstClientList] & ""
If Not Forms![navfrmClient]![NavigationSubform].RecordsetClone.NoMatch Then
   Forms![navfrmClient]![NavigationSubform].Bookmark = Forms![navfrmClient]![NavigationSubform].RecordsetClone.Bookmark
Else
   MsgBox "Could not locate [" & Me![lstClientList] & "]"
End If
End Sub

but doesnt seem to work.

i get run time errior 438
 
Assuming that you have set the Link Child and Link Master fields, then you can use the listbox to filter just the main form and access will automatically show you the matching records in the subform. This is much the same as using a combo instead of a listbox.
 

Users who are viewing this thread

Back
Top Bottom