check if report is open

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
 
M

Marshall Barton

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
 
L

LGarcia

Thanks!! That worked.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top