Reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to print a single record using report? I am entering
data using Forms for a purchase order. When I finish entering the data I
want to use a button on the Form to print the finished purchase order using
Report. I only want a single purchase order printed. Report wants to print
all the purchase orders. Is there a way to select the purchase order in Forms
and print out a single purchase order in Report?
 
Does anyone know how to print a single record using report? I am entering
data using Forms for a purchase order. When I finish entering the data I
want to use a button on the Form to print the finished purchase order using
Report. I only want a single purchase order printed. Report wants to print
all the purchase orders. Is there a way to select the purchase order in Forms
and print out a single purchase order in Report?

Your table should have a unique prime key field.

If so, add a command button to the form.
Code the command button's Click event:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]

The above assumes a [RecordID] field that is a Number Datatype.

If [RecordID] is Text Datatype, then use:

"[RecordID] = '" & [RecordID] & "'"

as the Where clause.

Change [RecordID] to whatever the actual field name is that you are
using.

See Access Help files for:
Where Clause + Restrict data to a subset of records'
 
Thanks for the help. This works perfectly.

fredg said:
Does anyone know how to print a single record using report? I am entering
data using Forms for a purchase order. When I finish entering the data I
want to use a button on the Form to print the finished purchase order using
Report. I only want a single purchase order printed. Report wants to print
all the purchase orders. Is there a way to select the purchase order in Forms
and print out a single purchase order in Report?

Your table should have a unique prime key field.

If so, add a command button to the form.
Code the command button's Click event:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]

The above assumes a [RecordID] field that is a Number Datatype.

If [RecordID] is Text Datatype, then use:

"[RecordID] = '" & [RecordID] & "'"

as the Where clause.

Change [RecordID] to whatever the actual field name is that you are
using.

See Access Help files for:
Where Clause + Restrict data to a subset of records'
 
Back
Top