Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Preview of Current Record ONLY?

Status
Not open for further replies.

earlgrey

Technical User
Nov 3, 2000
3
GB
I have a Preview Report button on a form. When I click this button it produces a Print Preview of the first record of ALL records that are available. I then have to use the Record Navigation buttons to find the print preview of the record I want.

What I want the Print Preview button to do is to show only the CURRENT record based on a reference number and not all records available.

Can anyone please advise.

Thanks in advance.
 
I use the filter options within the report form to limit the data displayed on the report. I would recommend trying it out to see how it works.

Open the report and try to fill in the Filter property. The code below passes a WHERE condition into that field. U Should also review the No_Data property of the report, which is commonly overlooked by developers.

htwh,

Steve

DoCmd.OpenReport stDocName, acPreview, , "" & lcWhere & ""
 
Steve,
I entered the above code in the Filter field on the Data tab of my report and made Filter On 'Yes', but when I clicked on the Preview Report button on my form a message box is displayed stating the following:

Syntax Error (Missing Operator) in query expression '(DoCmd.OpenReport stDocName, acPreview, , " & lcWhere & "")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top