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

Query

Status
Not open for further replies.

Twillz

Programmer
Nov 6, 2003
16
0
0
US
Can you write a query that would look in different tables for a record from what is enter on a search form. Example

Table1 Table2
ID Id
Customer Customer
Reason Reason
Date Date

The records would be looked up by their Id's (there are more than two tables). Can anyone help me

Thanks,
Will
 
yes and no.

Yes you can if you use a union query which is the union of all tables you are using, it can return your results. You will have to make sure that there is a unique key that is unique not only for each table, but for the union of each table. What you can do is place a letter infront of each of the unique keys in the union query, with a different letter for different tables, then searh over that concatination.

But if you want to make changes with a bound form, No you can not. You can not pass a parameter that specifies which table, meaning you can not willy nilly mid stride change the targe of your query, without explicitly redefining it and the bounding of your form.

If this is not for data entry or data changes, then go with a Union Query. Otherwise, rethink your strategy.





Randall Vollen
National City Bank Corp.

Just because you have an answer - doesn't mean it's the best answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top