Pull from two files

G

Guest

I am running MS Access 2002 and have two tables (members & vendors). I have
a check box in each table indicating if the attendee is a speaker. Need to
create a form that gives a listing of just the records in BOTH files that
have attendees checked as speakers. Can this be done?

Debbie
 
J

Jerry Porter

Debbie,

You can do this by using a union query. In the query design, select the
Query menu, then SQL Specific and then Union. Enter the SQL for the
query. It would be something like:

Select LastName, FirstName, "Member" as Type From tblMembers
Where Speaker = True
UNION
Select LastName, FirstName, "Vendor" as Type From tblVendors
Where Speaker = True

Of course, you'll need to modify this to fit your table design.

Jerry
 
J

John Vinson

I am running MS Access 2002 and have two tables (members & vendors). I have
a check box in each table indicating if the attendee is a speaker. Need to
create a form that gives a listing of just the records in BOTH files that
have attendees checked as speakers. Can this be done?

Debbie

It won't be updateable, but you can base your form on a UNION query to
"splice together" these two tables. See UNION in the Help file; if
it's not clear post back with the relevant table and fieldnames.

John W. Vinson[MVP]
 
J

Jeff Boyce

Debbie

Are you saying you want a list that consists of all "checked" tblMembers and
all "checked" tblVendors records? If so, one approach would be to first
create two queries, one for each table. These queries will need to return
the same set of fields (for simplicity, just the "Name" values).

Then create a third query, change the view to SQL, and turn it into a UNION
query with something like:

SELECT * FROM YourMembersQuery
UNION
SELECT * FROM YourVendorsQuery;

Note that UNION queries only work if you have the same number of fields in
each of the underlying queries. Note2 that UNION queries only make sense if
you have "equivalent" fields in each underlying query (i.e., you don't get
Names from the first query and Dates-of-Birth from the second).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top