Help with Docmd.RunSql Please

  • Thread starter Thread starter Shadow
  • Start date Start date
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/
 
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.
 
Back
Top