Hi Erin,
You can use VBA code to automatically maximize reports, and then issue a
restore command when they close the report. Here are procedures for
Report_Activate and Report_Close. I also included a procedure for
Report_NoData. If you use the NoData procedure, you can prevent a report from
opening when the recordset has zero records. If you do so, make sure to trap
for error 2501 in the calling procedure.
Option Compare Database
Option Explicit
Private Sub Report_Activate()
On Error GoTo ProcError
DoCmd.Maximize
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Report_Activate..."
Resume ExitProc
End Sub
Private Sub Report_Close()
On Error GoTo ProcError
DoCmd.Restore
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Report_Close..."
Resume ExitProc
End Sub
Private Sub Report_NoData(Cancel As Integer)
On Error GoTo ProcError
MsgBox "There is no data for the selected criteria.", _
vbInformation, "No Data Available..."
Cancel = True
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Report_NoData..."
Resume ExitProc
End Sub
There is also a "lightweight" means of accomplishing the same goal (maximize
and restore), where you use code in a stand-alone module, and expressions in
the report's property sheet. There is an example on the FMS web site, which I
can track down if you are interested. Otherwise, put the above code into each
report.
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________