Dynamic Query Via User Specified Fields With Multiple Tables

D

Daveo

Hi folks,

Please see the topic below:

http://groups.google.com/group/comp...User-Specified+Fields&rnum=1#1a3e9c73ad23414c

I was wondering if anyone knows how to alter this code include more
than one table in the query. E.g. a user can select 2 related tables
from the table list, the field list is then populated with the fields
from both, and the relationships are automatically transfered into the
SQL statement that is passed to the query.

I have no idea where to start!

Many thanks - David
 
R

Roger Carlson

Adding Joins to the mix is a whole new level of complexity. Not that a
simple Inner Join is so difficult, but the next thing they'll want is to
Join 3 tables that make up a Many-to-Many relationship, and then they'll
want Outer Joins, and then... At some point, just learning to use the Query
Builder is a better solution.

However, an alternative would be to create the Joins ahead of time and save
them as saved queries. That way you can use the existing code to select one
of these queries instead of a table.


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
D

Daveo

Hi Roger,

What a great solution - That'll save me hours of (prob. unnecessary)
work!

Many thanks - David

Many thanks
 

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