I have a form with a command button to open a preview of a report. When the command button is clicked on, the form is set to visible=false. When the button is clicked on, what actualy happens is: the form disappears, the database window becomes visible (the list of tables, forms, queries etc. not sure if thats what is called), and then the report preview becomes visible. I know I can eliminate the database window from becoming visible but am not having any luck. The relevant portion of the code I am using for the command button on click is as follows:
If Forms!frmPrintOptions!chk7 = True Then
DoCmd.Echo False, "Opening Report..."
stdocname = "rptReportName"
DoCmd.OpenReport stdocname, acViewPreview
DoCmd.Echo True, ""
End If
What am I doing wrong?
If Forms!frmPrintOptions!chk7 = True Then
DoCmd.Echo False, "Opening Report..."
stdocname = "rptReportName"
DoCmd.OpenReport stdocname, acViewPreview
DoCmd.Echo True, ""
End If
What am I doing wrong?