Select Query

Scatman

Registered User.
Local time
Today, 08:06
Joined
Feb 11, 2000
Messages
27
Simple Select Query?

I know to some of you, this is going to sound very simple. I want to select a group of records for a specific contractor to see what work they have done for us. I would like to pick from the list of contractors (tblContractors) and run my query based on THAT selection. I can't seem to get the query to do that.

Any Ideas?
 
Somehow you've got to be able to tell Access which contractors you want to include. You could just enter their names into the critieria lines of the query grid in design view.

The other option is to create a form with a pick list. A multi-select listbox works well for that. However, that might be more involved than you'd care to get.
 
Tried That

I've been trying to create a form with a pick list all day and I can't get the query to see the Contractor that I picked.

If you have an idea how to set that up, it would be helpful.

Thanks
 
Tried That

I've been trying to create a form with a pick list all day and I can't get the query to see the Contractor that I picked.

If you have an idea how to set that up, it would be helpful.

Thanks
 
Here's an article that explains in detail how to do it: Customizing Access Parameter Queries.

In brief, if you just want to select one contractor:
1- create a combo box with the list of contractor names
2- name the combo box something meaningful, like cboContractors
3- In your query, include the Contractors column in your query grid
4- In the criteria for the Contractors column, include a reference to the form field you just created like this:
Forms!Your_Form_Name!cboContractors.
 
Thanks

Well I FINALLY got it to work. I followed the article you sent to me and went step by step. Everything worked right up to the point where he had me enter the VB code for the After Update on the Form. I could not get that to work. It kept giving me an error, so I created a Macro that does the exact same thing that the VB Code would have done and it works. I'm not sure if there is a version problem with what he was using VS what I am using, but I could not get his code to work.

But then again, I'm no pro at this and havent written much VB code so it was probably my fault.

Anyways thanks for the help. Maybe someday I'll learn enough to help someone else out on here.
 
Good for you for working it out. The struggle is worth it.
 

Users who are viewing this thread

Back
Top Bottom