MS Access - execute a saved query by name in VBA

前端 未结 3 836
灰色年华
灰色年华 2020-12-30 23:33

How do I execute a saved query in MS Access 2007 in VBA?

I do not want to copy and paste the SQL into VBA. I rather just execute the name of the query.

This

3条回答
  •  再見小時候
    2020-12-31 00:34

    You can do it the following way:

    DoCmd.OpenQuery "yourQueryName", acViewNormal, acEdit
    

    OR

    CurrentDb.OpenRecordset("yourQueryName")
    

提交回复
热议问题