Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to requery form based upon value in combo box 1

Status
Not open for further replies.

HockeyFan

MIS
Jun 21, 2005
138
US
I have a form that is based upon a query. When it opens up it displays all of the records. This is working great.

I have a three combo boxes on this form. Box 1 is name, box 2 is project, and box 3 is workstream. They all have values in them that the user can select. This is working great.

I have a button that is pressed after the user selects their name, project and workstream, I would like the form to do a requery and base the results on the selected criteria from the combo boxes, instead of the initial query that the form is based upon. This is where the problem is at.

The button currently points to a macro that does a runcommand with a requery with no control specified. I was hoping this would accomplish what I wanted, but it's not working.
 
Duane, I have to apologize becuase I screwed up and made a dumb mistake. I put the name of the form in the module instead of the name of the query. I ran it and I received no errors, however there is not working quite as expected.
When you make your selection and then click the button, it prompts for parameter values from the 'appscmb' field, and the 'workstream' field even though they were selected on the dropdowns. If I type the value in that I am looking for, then it will work as it's supposed to.
your thoughts?
 
The field names 'appscmb' and 'workstream' were the names of the combo boxes. They were different names in the record source query. I modified your code and change All references to both of those field names, to the field names that are used in the record source query and it seemed to work well. Thank you, thank you, thank you.
 
You should learn to understand the answers rather than just copying and pasting code. We can't see your tables, queries, fields, error messages, controls, forms, code,...

We expect either you tell us or you understand how it works. One of the problems with these on-line forums is that we quite often don't have the time to document ever solution we provide. If you don't understand, please ask.

Duane
Hook'D on Access
MS Access MVP
 
I am able to do very little vba and I did try to look over your code, but I didn't completly understand it. That is why this happened. But thanks again, i appreciate your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top