View Full Version : Preview Toolbar when a Report is opened from front end


Sreedevi
03-11-2008, 08:13 AM
Hi

I want to have Preview toolbar when my report is opened on click of button from front end form.

What I am trying is, I have specified a query as the record source of the report. And in front end form on click of button I have called a macro that opens the report (Open Report) I have mentioned the Name of the report and the view as Print Preview in the macro. But this doesn't work.

Then along with the above procedure I tried this piece of code on open/Activate of report:-
DoCmd.ShowToolbar "Print Preview", acToolbarYes

Still doesnt work.

Now I am trying running the code through macro and the code is like:-

Dim strReportName As String

strReportName = "abc"
DoCmd.OpenReport strReportName, acPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdZoom100
DoCmd.ShowToolbar "Print Preview", acToolbarYes

but still it doesnt work.

Menu's of preview toolbar appears when we right click on the report,
I just want, what ever is there on the right click should appear as a toolbar.

Can someone suggest me something its really urgent. Even a small effort will be highly appreciated.

apr pillai
03-15-2008, 12:50 PM
Try running the last line of code

DoCmd.ShowToolbar "Print Preview", acToolbarYes

from the On Open event of the Report, if you are not already doing it.

http://msaccesstips.com