ACC: How to Print a Single Record from a Form in a ReportID: Q98801
|
Moderate: Requires basic macro, coding, and interoperability skills.
This article shows you how to select a single record on a form and to print
it in a report.
The following procedure prints only the record that you select from the
Customers form in the sample database Northwind.mdb (or Nwind.mdb in
earlier versions).
Macro Name Action
-----------------------------
mcrPrintRecord RunCommand
OpenReport
mcrPrintRecord Actions
--------------------------------------------------------------
RunCommand
Command: Save Record
OpenReport
Report Name: rptPrintRecord
View: Print Preview
Where Condition: [CustomerID]=Forms![Customers]![CustomerID]
Macro Name Action
-----------------------------
mcrPrintRecord DoMenuItem
OpenReport
mcrPrintRecord Actions
--------------------------------------------------------------
DoMenuItem
Menu Bar: Form
Menu Name: Records
Command: Save Record
OpenReport
Report Name: rptPrintRecord
View: Print Preview
Where Condition: [CustomerID]=Forms![Customers]![CustomerID]
Macro Name Action
---------------------------
mcrPrintRecord DoMenuItem
OpenReport
mcrPrintRecord Actions
--------------------------------------------------------------
DoMenuItem
Menu Bar: Form
Menu Name: File
Command: Save Record
OpenReport
Report Name: rptPrintRecord
View: Print Preview
Where Condition: [CustomerID]=Forms![Customers]![CustomerID]
Name: cmdPrintRecord
Caption: Print Record
OnClick: mcrPrintRecord
ControlName: cmdPrintRecord
Caption: Print Record
OnPush: mcrPrintRecord
Additional query words: one
Keywords : FmsOthr
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 24, 1999