Good day,
I have a “List Box” with three Report names in it.
The name of the “ListBox” is ViewReport
“Products All”
“Products Phase Out”
“Products Non Phased Out”
Currently I have a macro that opens the correct form in dialog mode the moment I double click on any of the three report names in the “List Box”…and it works perfectly!
I would like to change the procedure by adding a Button next to the “List Box” to replace the Double click function…instead I would like to select the report from the list and then click the Button to open the selected report.
I tried the following code and I lot of other code but don’t seem to get it right.
Private Sub OpenReport_Click()
Dim stDocName As String
stDocName = Me.ViewReport.DefaultValue
DoCmd.OpenReport stDocName, acViewPreview, , , acDialog
End Sub
Any advice will be appreciated.
Thanks
Theuns
I have a “List Box” with three Report names in it.
The name of the “ListBox” is ViewReport
“Products All”
“Products Phase Out”
“Products Non Phased Out”
Currently I have a macro that opens the correct form in dialog mode the moment I double click on any of the three report names in the “List Box”…and it works perfectly!
I would like to change the procedure by adding a Button next to the “List Box” to replace the Double click function…instead I would like to select the report from the list and then click the Button to open the selected report.
I tried the following code and I lot of other code but don’t seem to get it right.
Private Sub OpenReport_Click()
Dim stDocName As String
stDocName = Me.ViewReport.DefaultValue
DoCmd.OpenReport stDocName, acViewPreview, , , acDialog
End Sub
Any advice will be appreciated.
Thanks
Theuns