Full Version: print preview
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
kenjed
I would like to ask someone if anybody can give me a simple code for a button of print preview
where in I want to preview the record from the current in the form

example got a record user on 1
record user on 2
user record on 3

then i view record 3 on my current form and click the button print preview I want the print preview to see only th records from 3 only

currently my button print preview is"

Dim stDocName As String

stDocName = "MECBLANKS3"
DoCmd.OpenReport stDocName, acPreview

It only shows the 1st record or the page 1 then i have to click from page 1 to 3 to see the preview record on 3, then when printing i have to set page 3 of 3 to print only the page 3 or records 3, is there some code for only shortcut to preview page 3?
mishej
You can use the WHERE parameter of the OpenReport command to limit the records for the report to the one you want to see. For example:

DoCmd.OpenReport "rptName", acViewPreview,,"[ID]=" & Me!txtID

Here I open "rptName" but limit its records to those where the ID is equal to the value in txtID control on the current form.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.