Printing Current Record on Form

  • Thread starter Thread starter Greg Ripper
  • Start date Start date
G

Greg Ripper

What is the button code to have a report, rptDiscipline, print just the current
record on the form, frmPaperwork?

Rip
 
Greg said:
What is the button code to have a report, rptDiscipline, print just the current
record on the form, frmPaperwork?

Rip
Add a Command Button to your Form.
Code it's Click event:
DoCmd.OpenReport "rptDiscipline",acViewPreview, , "[RecordID] = " &
[RecordID]

The above assumes your table has a unique prime key field named
[RecordID] and it is of Number Datatype.

Change [RecordID] to whatever the actual name of that field is.
Change acViewPreview to acViewNormal to print the report without
preview.

If [RecordID] is a Text Datatype then use:
"[RecordID] = '" & [RecordID] & "'"
 
Back
Top