Help with Docmd.RunSql Please

S

Shadow

How can I create a UNION query with DoCmd.RunSql statement in VBA?

this doesn't work for me.

PerRst = "SELECT * FROM tblInOutDoc UNION SELECT * FROM tblTempInOutDoc;"
DoCmd.RunSQL PerRst



thanks for any kind of advice/
 
A

Allen Browne

RunSQL is for action queries.

If you want to examine the results programmatically, use OpenRecordset().
If you want to view the results on screen, use OpenQuery.
 
Top