Hi,
I have users who repeatedly forget to close a report before opening a form. This causes that are not an issue if the report is closed. I've been looking for code to that will give a warning to the user to close any open reports and stop the next form from loading if reports are open. Nothing I've tried works. What would a sample of this code look like?
Thanks!
Leesha
Stop Code if Report is in Print Preview
-
- BronzeLounger
- Posts: 1489
- Joined: 05 Feb 2010, 22:25
-
- Administrator
- Posts: 78608
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Stop Code if Report is in Print Preview
Perhaps
Code: Select all
If Reports.Count > 0 Then
MsgBox "Please close all reports, then try again!", vbInformation
Exit Sub
End If
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1489
- Joined: 05 Feb 2010, 22:25
Re: Stop Code if Report is in Print Preview
Thanks Hans! It worked perfectly!!