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

Multi-table Query Criteria

Status
Not open for further replies.

rickyoswald

Programmer
Jun 12, 2004
59
0
0
GB
I am using the same criteria on several queries;
(SELECT[Field]FROM
)
Where the Field is ID and the Table is tblQryID. A Visual Basic application sends data into the field then any records in the query whos field with the criteria does not match that of the on the criteria points to will get filtered out.
This works absolutely fine provided the query only has fields from one table!
 
I'm sorry, but what is your question?

zemp
 
The criteria works if the query only contains data from one table. If there is more than one table it ceases to work. Why is this?
 
Could be that the tables are not joined properly.

Post your SQL statement and list the tables relationships (PK and FK).

zemp
 
I have three tables; tblQryID, tblClients and tblCases. tblClients holds client info and tblCases holds case information while tblQryID holds a string from a VB app. There is a report called rptClientCases which holds information from the tables tblClients and tblCases, these are connected as one to many. I set up a query that held the criteria for tblClients, field "Name" :
(SELECT[ID]FROM[tblQryID])

So when the VB app sends a string to the field and runs the report it will only show the report with the name that matches that of the string sent by the VB app.
I have used the same query criteria in other parts of my database, they only work if there is one table involved (beside tblQryID). I am using Access 2003 on windowsXP with all the latest updates and such. I have searched on google and such but cannot seem to find anything on it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top