John,
I already have an SQL string in VBA for one table. See below for the code. I
am hoping to find out if and how can I use variables, etc. to select a
different table for the SQL. For example, I can use "dim variablename as
string" and assign a table name to this variable based on the selection from
a combo box. What I am not sure is how to incorporate this variable into the
SQL! When I use "dim" is that a global variable so that I can use it outsite
of a sub? Otherwise, how can I pass it to the SQL? Can I use
"variablename.[First Name] to selec the table? Let me know your feedback
regardless of if I endup combining all the tables into one.
I agree with you about combining the tables into one. There are two issues.
One is each table, even though a contact table, has very different fields.
For example, for one contact type I need to track their spouse
name/phone/email, etc. versus another contact type where I need to track
their assistant's name/phone/email. etc. There are also other differences.
So, it will not be an efficient single table with many empty fields.
Nevertheless I am considering combining them. However, I am hoping that there
is a easy way to combine the tables into one, rather than creating a new one
with all the fields from scratch! Is there a way? Like append or merge one
table to another!
Thanks,
AC Erdal
___ SQL string
SELECT [Last Name] & "," & [First Name] AS Expr1, Sellers.[First Name],
Properties.[Property Address] FROM Properties INNER JOIN (Sellers INNER JOIN
[Transaction] ON Sellers.[ID-Sellers]=Transaction.[ID-Sellers]) ON
(Properties.[ID-Properties]=Transaction.[ID-Properties]) AND
(Properties.[ID-Properties]=Transaction.[ID-Properties]);
________
[quoted text clipped - 19 lines]
instead incorporating all of these tables into one with an additional field
containing what's now the tablename?