Preview

A

AHopper

I have a split database MDE front end MDB backend on a network. The
workstations are using Access Runtime. From a command button on a form I want
to preview 2 reports. The form is a pop up form named "SkidReportDialogBox"
which is opened form a command button on another form. The command button is
named "PreviewReport". The two reports are named "SkidReport" and
"WeightSkidReport". Below is the code I am presently using, which is opening
and maximizing the reports. Following the code are my questions.

On Error GoTo Err_PreviewReport_Click
MsgBox "To preview a report for all skids leave the ""Skid Number"" blank.",
vbInformation

Dim stDocName As String
Dim stDocNameTwo As String

stDocName = "SkidReport"
stDocNameTwo = "WeightSkidReport"
With Me
If IsNull(.JobNumber) Or .JobNumber = 0 Then
Answer = MsgBox("To continue select an ""Job Number"".", vbOKOnly)
If Answer = vbOK Then Exit Sub
End If
If IsNull(.SkidNumber) Then
Answer = MsgBox("Do you want to preview ALL SKIDS report?", vbYesNo +
vbQuestion)
If Answer = vbYes Then
DoCmd.OpenReport stDocName, acViewPreview, ,
"[JobNumber]=[Forms]![SkidReportDialogBox]![JobNumber]"
DoCmd.Maximize
Exit Sub
End If
If Answer = vbNo Then
Answer = MsgBox("To continue select a ""Skid Number"".", vbOKOnly)
If Answer = vbOK Then Exit Sub
End If
End If
End With
DoCmd.OpenReport stDocName, acViewPreview, ,
"[JobNumber]=[Forms]![SkidReportDialogBox]![JobNumber] AND
[SkidNumber]=[Forms]![SkidReportDialogBox]![SkidNumber]"
DoCmd.Maximize
DoCmd.OpenReport stDocNameTwo, acViewPreview, ,
"[JobNumber]=[Forms]![SkidReportDialogBox]![JobNumber] AND
[SkidNumber]=[Forms]![SkidReportDialogBox]![SkidNumber]"
DoCmd.Maximize

Exit_PreviewReport_Click:
Exit Sub

Err_PreviewReport_Click:
MsgBox Err.Description
Resume Exit_PreviewReport_Click

Questions:
1. Presently the reports open and Maximize. Is there a better way to achieve
this?

2. How can I open the report both maximized and at 100%?

3. The form is a pop up form which means it stays on top of the prieview and
the users have to keep moving it to see the report preview. How can I make
the previews come to the front until they are closed and then the pop up form
come back?

4. How would I limit the users so they only have the ability to open, move
from page to page in the preview and close the preview? Presently the user
has to use the scroll bars, close button, navigator Buttons on the open
report preview. This is the only place in my application that a user needs to
know how to use these. Throughout the rest of the application users use
command buttons. As I mentioned before, users have Access Runtime and I would
like to use the most user friendly way to achieve this.

Thank you for your support and help

Allan
 
Top