My Assistant
![]() ![]() |
|
|
Nov 12 2004, 12:00 AM
Post
#1
|
|
|
New Member Posts: 2 |
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? |
|
|
|
Nov 12 2004, 12:25 AM
Post
#2
|
|
|
Retired Moderator Posts: 11,289 From: Milwaukee, WI |
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. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 24th May 2013 - 11:36 PM |