Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

Filter a subform with a button in Main Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MikeP125 - 13 Jun 2007 17:50 GMT
I am trying to filter a subform by clicking a buton in the main form.  Here
are the form and filed names:
Key:
Main form = frmMain
Field in Main Form = POLookup (this is a text string and is the filter
criteria)
Subform = frmSub
Field in Subform = PONo (this is a text string and should be filtered
according the value in POLookup on the main form)

Here is the code for the button called POFilter:

Private Sub POFilter_Click()
Me.frmSub.Form.Filter = "me. frmSub.Form.PONo'" & Me.POLookup & "'"
Me. frmSub.Form.FilterOn = True
Me. frmSub.Form.Refresh
End Sub

Please help me correct my errors. Thank you for your help
MikeP125 - 13 Jun 2007 18:12 GMT
Correction in my code:
Me.frmSub.Form.Filter = "me. frmSub.Form.PONo ='" & Me.POLookup & "'"
(I forgot to include the equal sign.)

> I am trying to filter a subform by clicking a buton in the main form.  Here
> are the form and filed names:
[quoted text clipped - 15 lines]
>
> Please help me correct my errors. Thank you for your help
Maurice - 13 Jun 2007 18:55 GMT
Try this:

Me.frmSub.Form.Filter = "PONo ='" & Me.POLookup & "'"
Signature

Maurice Ausum

> Correction in my code:
> Me.frmSub.Form.Filter = "me. frmSub.Form.PONo ='" & Me.POLookup & "'"
[quoted text clipped - 19 lines]
> >
> > Please help me correct my errors. Thank you for your help
MikeP125 - 13 Jun 2007 20:06 GMT
Thank you, it worked perfectly!

> Try this:
>
[quoted text clipped - 23 lines]
> > >
> > > Please help me correct my errors. Thank you for your help
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.