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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top