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

Reuseable Select Query on Multiple Tables

Status
Not open for further replies.

rjstephan

Technical User
Mar 15, 2002
15
US
I have a select query with two linked tables. I want to be able to dynamically change one of the tables in the query to any one of 50 identically structured tables so I don't have to have 50 queries that are all the same except for one of the linked tables it references. The idea is to get a prompt: Which ID? and then the query would load with that ID's table. How can I accomplish this the easiest? Thanks for your help.
 
You can have a combo box on a form where the user can select the table. Behind a button, you can have SQL code that runs your query and the part of the SELECT code can be "[forms]![YOUR FORM NAME]![TABLE FIELD NAME]" intstead of actually naming the table. Hope that helps.

Jim DeGeorge [wavey]
 
Thanks! OK, I got the combo box part and I looked at the SQL SELECT code that currently is the RecordSource for the Form, and I assume an AfterUpdate event on the Combo Box would trigger the change in the RecordSouce for the Form, but how do I get the stored variable Value in the Combo Box into the SQL for the RecordSource?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top