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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Updating subforms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tray - 10 Jan 2008 14:01 GMT
I have a form that I'm using to show sales relating a specified month.

On this form I have 3 combo boxes - One to select the company, one for the
month and one for the year.

I have created a query which takes all the fields from the sales table. I
have added this query as a subform, so that each sale can be seen.

What I was hoping to do is have the subform display the sales once the user
has selected the company, month and year in the combo boxes. On the query, I
have set the criteria for these three fields to match the combo boxes on the
form.
ie: the criteria for the company field is [Forms]![Sales
Figures]![companyName]

However, I can't get the subform to refresh once the user has selected the
three filters and display the relevant data.
Allen Browne - 10 Jan 2008 14:08 GMT
You could use the AfterUpdate event procedure of the combos to Requery the
form, i.e.:
   Me.Requery

You may find it more efficient to set the form's Filter, based on whatever
combination of the boxes the user entered something in. Here's an example of
how to code that:
   Search form - Handle many optional criteria
at:
   http://allenbrowne.com/ser-62.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a form that I'm using to show sales relating a specified month.
>
[quoted text clipped - 16 lines]
> However, I can't get the subform to refresh once the user has selected the
> three filters and display the relevant data.
 
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



©2009 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.