G
Guest
I'm trying to create a Form that basically allows users to Choose a Report ,
then how they wish to view the report by selecting Option Button A (Summary)
or Option Button B (Detail).
Below is my VB Coding:
Option Compare Database
Private Sub Command17_Click()
DoCmd.Close acForm, "form3d"
End Sub
Private Sub Command18_Click()
Dim var
DoCmd.OpenReport selectedReport.Tag, acViewNormal
DoCmd.Close acForm, "form3d"
End Sub
Private Sub PREVIEW_Click()
DoCmd.OpenReport selectedReport.Tag, acViewPreview
DoCmd.Close acForm, "form3d"
End Sub
Private Sub selectedReport_Change()
Select Case selectedReport
Case "Field Office Summary Constrained"
selectedReport.Tag = ""
Case "Main Output Constrained"
selectedReport.Tag = " "
Case "Main Output Constrained Summary"
selectedReport.Tag = " "
Case "Field Office Summary Optimal"
selectedReport.Tag = " "
Case "Field Office Summary Optimal - Summary"
selectedReport.Tag = " "
Case "Main Output Optimal"
selectedReport.Tag = " "
Case "Main Output Optimal Summary"
selectedReport.Tag = " "
Case "Summary 4"
selectedReport.Tag = " "
Case "Summary 4-Summary"
selectedReport.Tag = " "
Case "Exemptions"
selectedReport.Tag = " "
Case "Summary 3"
selectedReport.Tag = " "
Case "Summary 3-Summary"
selectedReport.Tag = " "
Case "Summary 2"
selectedReport.Tag = " "
Case "Summary 2-Summary"
selectedReport.Tag = " "
Case "Summary 1"
selectedReport.Tag = " "
Case "Summary 1-Summary"
selectedReport.Tag = " "
Case "Air Passenger Inspection"
selectedReport.Tag = " "
Case "Air Passenger Inspection Summary"
selectedReport.Tag = " "
Case "Land Passenger Inspection"
selectedReport.Tag = " "
Case "Sea Passenger Inspection"
selectedReport.Tag = " "
Case "Cargo Inspection"
selectedReport.Tag = " "
Case "Cargo Inspection Summary"
selectedReport.Tag = " "
Case "Seizures Inspection"
selectedReport.Tag = " "
Case "Seizures Inspection Summary"
selectedReport.Tag = " "
Case "Agriculture Inspection"
selectedReport.Tag = " "
Case "Agriculture Inspection Summary"
selectedReport.Tag = " "
Case "Processing Times"
selectedReport.Tag = " "
Case "Percentage Factors"
selectedReport.Tag = " "
Case "Global Assumptions"
selectedReport.Tag = " "
End Select
End Sub
Private Sub selectedReport_AfterUpdate()
DoCmd.Close acForm, "form3d"
End Sub
then how they wish to view the report by selecting Option Button A (Summary)
or Option Button B (Detail).
Below is my VB Coding:
Option Compare Database
Private Sub Command17_Click()
DoCmd.Close acForm, "form3d"
End Sub
Private Sub Command18_Click()
Dim var
DoCmd.OpenReport selectedReport.Tag, acViewNormal
DoCmd.Close acForm, "form3d"
End Sub
Private Sub PREVIEW_Click()
DoCmd.OpenReport selectedReport.Tag, acViewPreview
DoCmd.Close acForm, "form3d"
End Sub
Private Sub selectedReport_Change()
Select Case selectedReport
Case "Field Office Summary Constrained"
selectedReport.Tag = ""
Case "Main Output Constrained"
selectedReport.Tag = " "
Case "Main Output Constrained Summary"
selectedReport.Tag = " "
Case "Field Office Summary Optimal"
selectedReport.Tag = " "
Case "Field Office Summary Optimal - Summary"
selectedReport.Tag = " "
Case "Main Output Optimal"
selectedReport.Tag = " "
Case "Main Output Optimal Summary"
selectedReport.Tag = " "
Case "Summary 4"
selectedReport.Tag = " "
Case "Summary 4-Summary"
selectedReport.Tag = " "
Case "Exemptions"
selectedReport.Tag = " "
Case "Summary 3"
selectedReport.Tag = " "
Case "Summary 3-Summary"
selectedReport.Tag = " "
Case "Summary 2"
selectedReport.Tag = " "
Case "Summary 2-Summary"
selectedReport.Tag = " "
Case "Summary 1"
selectedReport.Tag = " "
Case "Summary 1-Summary"
selectedReport.Tag = " "
Case "Air Passenger Inspection"
selectedReport.Tag = " "
Case "Air Passenger Inspection Summary"
selectedReport.Tag = " "
Case "Land Passenger Inspection"
selectedReport.Tag = " "
Case "Sea Passenger Inspection"
selectedReport.Tag = " "
Case "Cargo Inspection"
selectedReport.Tag = " "
Case "Cargo Inspection Summary"
selectedReport.Tag = " "
Case "Seizures Inspection"
selectedReport.Tag = " "
Case "Seizures Inspection Summary"
selectedReport.Tag = " "
Case "Agriculture Inspection"
selectedReport.Tag = " "
Case "Agriculture Inspection Summary"
selectedReport.Tag = " "
Case "Processing Times"
selectedReport.Tag = " "
Case "Percentage Factors"
selectedReport.Tag = " "
Case "Global Assumptions"
selectedReport.Tag = " "
End Select
End Sub
Private Sub selectedReport_AfterUpdate()
DoCmd.Close acForm, "form3d"
End Sub