Printing Current Record in a Form as a Report

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

Guest

Can I put a command button on a form the will Print Preview a Report of that
current record showing in the form?
 
Hi LilBomShl,

Yes, you can. Set the query powering the report so that it picks up the ID
of the record off the form, like this:

select * from TABLENAME where IDFIELD = forms!FORMNAME.IDFIELDNAME

Then use the following in the on click event of the command button:

docmd.openreport "REPORTNAME", acViewPreview

Hope this helps.

Damian.
 
Thank you!!

LiL

Damian S said:
Hi LilBomShl,

Yes, you can. Set the query powering the report so that it picks up the ID
of the record off the form, like this:

select * from TABLENAME where IDFIELD = forms!FORMNAME.IDFIELDNAME

Then use the following in the on click event of the command button:

docmd.openreport "REPORTNAME", acViewPreview

Hope this helps.

Damian.
 
Back
Top