Hi All,
I have a problem with filters and sub forms, I just cannot get the code to work.
when I use the filter on the subform as a stand alone form the filter works, the Button code I use is:-
as1 = "[Staff Number] like '" & Pubstaffno & "'"
DoCmd.GoToControl "staff number"
DoCmd.ApplyFilter , as1
Me.FilterOn = True
The Main form is called VISITORS and the sub form itself is called VISITS SUBFORM CONT.
When I execute the filter code when it is actually a sub form, it fails, because the subform is now contained within the main form.
I have tried all sorts of changes to try and make it work, but nothing I do seems to work. If anyone can help I would be extremely grateful.
many thanks
James
I have a problem with filters and sub forms, I just cannot get the code to work.
when I use the filter on the subform as a stand alone form the filter works, the Button code I use is:-
as1 = "[Staff Number] like '" & Pubstaffno & "'"
DoCmd.GoToControl "staff number"
DoCmd.ApplyFilter , as1
Me.FilterOn = True
The Main form is called VISITORS and the sub form itself is called VISITS SUBFORM CONT.
When I execute the filter code when it is actually a sub form, it fails, because the subform is now contained within the main form.
I have tried all sorts of changes to try and make it work, but nothing I do seems to work. If anyone can help I would be extremely grateful.
many thanks
James