Updating subforms

T

Tray

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.
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top