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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One Form....Multiple Queries

Status
Not open for further replies.

dots

Technical User
Jul 13, 2001
24
US
Is it possible to use the same form and change the recordsource to different queries?

I have a form that, depending on which button is clicked, the user could look up information by different fields. Do I need to copy the form and change the recordsource to the query they need to use for each criteria....or is there a more efficient way to do this?

I'm using Access 2000.
 
Hi

As long as the fields in each query are the same, you can switch the recordsource of the form. In the on click event for you button you would use:

Me.RecordSource = "yourqueryname"

HTH

Nigel
Didn't someone say work is supposed to be fun? They didn't have computers then I guess....
 
[tt]
Hi:

Why have separate queries? You can have combo boxes that rely on different fields in the same table/query to look up records. Or, you can do the same thing in text boxes, but the combo box is usually more efficient that requiring the user to remember what to type into the text box.

Use the wizard to place combo boxes that will look up and display records based on the field you choose for each combo box.

Or, did I not understand what you're trying to do?[/tt]

[glasses][tt]Gus Brunston - Access2000(DAO)
Skill level based on 1-10: 7, on the way to 6, and beyond!
Webmaster: www.rentdex.com[/tt]
 
Nigel,

This is a dumb question, but do you put the Me.Recordsource statement before or after the Open Form statement?

I've tried it both ways and I can't seem to get it to work.

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top