View Full Version : Creating a PreviewReport Function


lafingmoon
08-07-2007, 12:16 PM
I am doing my Access 2003 Homework and we are to Create a PreviewReport Function to open a report in the Print Preview window. I have no idea where to start. The book only shows me how to do a CapAll Function. SOMEONE PLEASE HELP!

ByteMyzer
08-07-2007, 02:32 PM
As I trust you are genuinely looking for a starting reference point, and not someone to do your homework, here you go:

In Microsoft Access, Go to the Help file (F1) and do a search on the following keyword: OpenReport

Providing that you can write a function in Visual Basic, you should have no trouble making use of the information that you find.

lafingmoon
08-07-2007, 05:38 PM
Thanks for the input. I finally figured it out. I have been sitting here trying to do this all day, I just needed to get up and clear my mind for a moment. Oh by the way below is what I needed to use.

Private Function PreviewReport()
'Open the selected report in Print Preview window.
DoCmd.OpenReport lstReportList, acViewPreview
End Function

Thanks again

RuralGuy
08-07-2007, 06:19 PM
Some times a gentle nudge in the right direction is all that is needed. Good job Myzer.