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

How to select a query's FIELD NAME based on a field in second query.

Status
Not open for further replies.

KalEl33

Programmer
May 20, 2002
17
US
I have a query (Query1) in which I would like to select the field name based upon the result of another query (Query2). In other words, lets say I have a table which contans the fields: Field1, Field2, Field3. I have a Query2 which returns a string such as "Field2". I would like to take that string and select Field2 to be used in Query1. How do I do this?

Thanks in advance!
Kal-El
 
Can you show how the queries would look in an sql statement. It is probably easier to understand what you are looking for that way.
 
One method would be to open the first recordset - say rs1 with field field2 and use the parameter rs1!field2 in the second query.

PK Odendaal
pko@942.co.za

 
A second method might be to inner join the two tables on that field. PK Odendaal
pko@942.co.za

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top