Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Compare Database
Public WithEvents rpt As Access.Report
Private Sub cmdOpen_Click()
Const rptName = "rptCustomers"
'If you open the report in dialog you will have to add a workaround
DoCmd.OpenReport rptName, acViewPreview
Set rpt = Reports(rptName)
'the below line of code is needed if you do not manually put [Event Procedure]
'in the reports OnClose event property. Easier to add it manually.
rpt.OnClose = "[Event Procedure]"
End Sub
Private Sub rpt_Close()
MsgBox "The Report " & rpt.Name & " is now closed."
End Sub
Private Sub cmdOpenDialog_Click()
'If you plan to open dialog then you will have less flexibility or need a bigger workaround than this
'Set the PopUp property to yes in the report at design time
'You will have to set the OnClose property to [Event Procedure] as design time
'You have to open the report by the format Report_YourReportName
Set rpt = New Report_rptCustomers
rpt.Visible = True
End Sub