Hi All
I would like to translate this union query (in which all the table fields have been deleted to make the thing shorter) into a make-table query. The union query works perfectly and produces the expected result in datasheet view, but as, I am running the whole application in VBA, really need to create a usable and reference-able table.
SELECT
15 fields
FROM Table1
INNER JOIN Table2 ON Table1.[Field] = Table2.[Field]
WHERE (((Table2.Field2) Like '*')
AND ((Table2.[Field]) Like '*')
AND ((Table2.Field3) Like '*' ))
GROUP BY
15 Fields
UNION SELECT
15 Fields
FROM Table1
INNER JOIN Table2 ON Table1.Field2 = Table2.Field2
WHERE (((Table2.Field2) Like '*')
AND ((Table2.[Field]) Like '*')
AND ((Table2.Field3) Like '*' ))
GROUP BY All Fields
ORDER BY Table1.Field4;
I have tried the INTO Table command, in various places, and get an error message that I cannot use an action query for a row source.
Is there a way or is it possible to generate a table using a VBA command on the SQL string which is the source of the query?
(The asterisks are replaced with variables during the execution of other functions)
I hope this all makes sense
Regards
Robert
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!