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

Create a Query 1

Status
Not open for further replies.

math20

MIS
Jul 7, 2005
71
CA
Hi,

I am trying to create a query that will take its table name from a text box in a form. Basically what I want to do is run a simple query with Field name remaining same for any table I type in the text box. If possible I would like instead of text box a combo box that shows all my table and I select the table I want the query to run keeping the field name same, like field1, filed2, filed3. I know I am kinda reapeating myself.
I hope someone can help me.
 
This means you have several tables that all have field(s) with the same name?

If you use a combo box, you could just have code that creates:
strSQL = "Select flda, fldb, fldc from " & me.cboTableList & ";"

Of course if you're trying to join multiple tables, the code needs to be smarter.

"Have a great day today and a better day tomorrow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top