Hi all,
I am trying to write a small procedure to check if an application is running. I have found some code that MS states runs in VB but I cannot get it to run in Access 2003.
This what I've found for VB, which i tried placing in the modules section
But I cannot get it to run in access. Can anyone please help.
Many thanks
James
I am trying to write a small procedure to check if an application is running. I have found some code that MS states runs in VB but I cannot get it to run in Access 2003.
This what I've found for VB, which i tried placing in the modules section
Code:
Declare Function GetModuleHandle Lib "KERNEL" (ByVal App As String) _
As Integer
Sub IsAppRunning()
Dim Response As Integer
'Call the GetModuleHandle function to determine if Microsoft
'Word is currently running
Response = GetModuleHandle("Winword")
'If Response is 0, then Word is not running. If Response is
'nonzero, then Word is running.
If Response = 0 Then
MsgBox "Application is not running"
Else
MsgBox "Application is running"
End If
End Sub
But I cannot get it to run in access. Can anyone please help.
Many thanks
James