Open report VBA script

benjamintsims

New member
Local time
Today, 07:28
Joined
Jun 25, 2007
Messages
3
Hi

Can anyone help me with a problem I am having getting a command button to open a report?

The VBA script generated by the wizard is

Private Sub openreport_Click()
On Error GoTo Err_openreport_Click


stDocName = "Recharge schemes all data"


Exit_openreport_Click:
Exit Sub

Err_openreport_Click:
MsgBox Err.Description
Resume Exit_openreport_Click

End Sub

But this is resulting in nothing happening when I click on the button.
Any ideas?

Thanks
Ben
 
After:

stDocName = "Recharge schemes all data"

Add:

DoCmd.OpenReport stDocName
 
Unfortunately that causes the report to print!
Any other ideas?
 
Sorry !

DoCmd.OpenReport stDocName, acViewPreview
 
Thanks, that works!

The next question is can I open the report so as to enable the use of hyperlinks in the report?
 

Users who are viewing this thread

Back
Top Bottom