Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

access: how to detect with VBA whether a query is opened?

Tags:

sql

vba

ms-access

is it possible to detect whether there is an open query using VBA in access-2007?

i am opening a query like this:

    stDocName = "Meeting_Reasons_Frequency"
  DoCmd.OpenQuery stDocName

is it possible to detect whether it is open?

like image 557
Alex Gordon Avatar asked Oct 21 '10 21:10

Alex Gordon


1 Answers

How about:

 If SysCmd(acSysCmdGetObjectState, acQuery, "QueryName") = acObjStateOpen Then

More info: http://msdn.microsoft.com/en-us/library/aa205281(office.10).aspx

like image 170
Fionnuala Avatar answered Sep 22 '22 13:09

Fionnuala