how to check if ms access is already open?

  • Thread starter Thread starter Jean-François Goulet
  • Start date Start date
J

Jean-François Goulet

Hi, I was wandered if someone would know how to verify if an instance of ms
access is already working (in process). It's just that my application open
ms access to print a report and this operation have to be done sometimes a
lot in a minute and I don't want to have like 15 different instances of ms
access running at once!

Thanks in advance!
//JF
 
Sorry about that and thanks anyway, I just found an answer to my question on
the net... here is the code (really simple by the way):

Dim objX As Access.Application

Set objX = GetObject(, "Access.Application")

If Not objX Is Nothing Then
MsgBox "MS Access is already open!"
End If

//JF
 
Just make sure you Set objX = Nothing when you're done, or the open instance
may not close properly.
 
Back
Top