Discussion Locked

MSAccess97 - Queries and Multiple Tables

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I need to setup a query to search the same named field (called NDC)in multiple tables. Each table will have this specific field, but may also have additional, different fields. Is this possible and how do you do it?

6 replies

by webmaster

If I understand correctly, you need to query and display the data contained in the NDC fields. If so then you can do so by creating a new query, and choosing the simple query wizard. Follow the wizard screens from there to pick and choose that NDCfield from each of the tables within your database.

by tonidefrees1

Additionally, these different fields that may appear in the various tables will also need to be viewed. If possible, my goal is to have one query that will search the NDC field in each table and return unique information found in each table.

by sl-campbell

As far as I know, you cannot create a permanent query object with a source table name that can be dynamically set - only the criteria can be set dynamically with a parameter query.
However, this can be done in code, either passing, or having the user input, the required info (table name to query on and criteria, if any, for the globally used field) to a Sub proceedure or Function which then builds a recordset or querydef object. Then you can use this recordset to base a form's source of data upon.

This discussion is closed to new replies.