check if report is open

  • Thread starter Thread starter LGarcia
  • Start date Start date
L

LGarcia

Hi all,
I need to check if a report is open and if so give a message to my user
telling them to close the report before they continue. The code would fit
behind a button. If the report is open it would be in print preview mode.
Using AccessXP
TIA,
LGarcia
 
LGarcia said:
I need to check if a report is open and if so give a message to my user
telling them to close the report before they continue. The code would fit
behind a button. If the report is open it would be in print preview mode.
Using AccessXP

If SysCmd(acSysCmdGetObjectState, acReport, "nameofreprot) >
0 Then
MsgBox :report is already open"
Else
DoCmd.OpenReport . . .
End If
 
Thanks!! That worked.

Marshall Barton said:
If SysCmd(acSysCmdGetObjectState, acReport, "nameofreprot) >
0 Then
MsgBox :report is already open"
Else
DoCmd.OpenReport . . .
End If
 
Back
Top