OpenReport

  • Thread starter Thread starter stealth
  • Start date Start date
S

stealth

Can someone help.

I have a menu form with command buttons on it. I have placed code ont
one of the buttons to open a report. However I would like to previe
the report before printing, upon clicking the button the reports start
printing. How can I change this. I can't find the property to tur
off.

thank yo
 
Thank you, but I the report is presented behind the menu. What do
need to select to revert the report to the front of the window and th
menu behind?

cheer
 
Stealth,

It could be that the "menu" is a form with its Modal property set to
Yes. I think it might work if you add a line like this...
DoCmd.SelectObject acReport, "NameOfYourReport"
.... to the code that opens the preview of the report.
 
No it still doesn't work but perhaps I've got the code wrong: this is
what I've written

Private Sub MonographOption_Click()
DoCmd.OpenReport "Monographs", acViewPreview
DoCmd.SelectObject acReport, "Monographs"
End Sub

Can I have more than 1 DoCmd in a Sub?

cheers
 
Stealth,

Yes, that's what I had in mind. And yes, you can have more than one
DoCmd in a sub. So, sorry it didn't do the trick. I guess these are a
few other options as I see it...
1. Set the Model property of the form to No. Possible the Popup
property as well.
2. Close the form when the report is previewed, i.e. the code might
look like this...
Private Sub MonographOption_Click()
DoCmd.OpenReport "Monographs", acViewPreview
DoCmd.Close acForm, Me.Name
End Sub
3. Hide the form when the report is previewed, i.e. the code might look
like this...
Private Sub MonographOption_Click()
DoCmd.OpenReport "Monographs", acViewPreview
Me.Visible = False
End Sub
.... in this case, you will probably want to put code on the Close event
of the report to un-hide the form again, which might look like this...
Private Sub Report_Close()
DoCmd.SelectObject acForm, "NameOfYourForm"
End Sub
 
Back
Top