fIsAppRunning Application running issue

  • Thread starter Thread starter pubdude2003 via AccessMonster.com
  • Start date Start date
P

pubdude2003 via AccessMonster.com

Here's my snippet, it opens the MsgBox whether Outlook is open or not.

If fIsAppRunning("Microsoft Outlook") = False Then
MsgBox "Please open your Outlook application"
Exit Sub
End If

When I run ?fIsAppRunning("Microsoft Outlook") in the debug window it works
fine showing True or False depending on whether Outlook is open. But the code
above just doesn't seem to work properly. Any help would be appreciated.
 
Okay, it gets weirder. I have the same snippet of code on two other buttons
on the same form AND on one OnOpen event. Identical code... all three work
fine. It's just this snippet that fails.
 
here's all of the code from the failing button
Private Sub Command639_Click()
On Error GoTo err639
If fIsAppRunning("Microsoft Outlook") = 0 Then
MsgBox "Please open your Outlook application"
'Shell ("C:\Program Files\Microsoft Office\OFFICE11\outlook.exe")
Exit Sub
End If

DoCmd.OpenForm "ReminderPoPUP"
Exit_Command639_Click:
Exit Sub

err639:

MsgBox Err.Description
Resume Exit_Command639_Click
End Sub

And here's all of the code on one of the buttons that works
Private Sub Command598_Click()
On Error GoTo Err_Command598_Click

If fIsAppRunning("Microsoft Outlook") = 0 Then
MsgBox "Please open your Outlook application"
'Shell ("C:\Program Files\Microsoft Office\OFFICE11\outlook.exe")
Exit Sub
End If

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmCalendar2"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command598_Click:
Exit Sub

Err_Command598_Click:
MsgBox Err.Description
Resume Exit_Command598_Click


End Sub
 
sigh.... I packed it in for the night and shut down the machine. This
morning it run's like a charm. I guess it needed the reboot to clear the
ghosts....
 
Back
Top