add a table with vba to a query

  • Thread starter Thread starter klwemu
  • Start date Start date
K

klwemu

i want to add a table to a existing query. the problem is the correct
syntax.

when i simple add the tablename in the WHERE, it works in the most
simple cases - but with complex queries, i receive mostly a syntax
error.

with vba i see no way to parse the sql string to get a working syntax.

my idea: is it not possible to call the function behind the frontend
"add tables" feature?
(what you are using in the query composer)

something like: AddTableToQuery(qdName, tabName)

the function should also add the relations.

regards, klwemu
 
Can you provide an example of a failed SQL string? Usually, formulating an
SQL string is fairly straigtforward and very flexible. Have you tried
building a query visually and then using the underlying SQL to see how to
include all of the tables you want?
 
Back
Top