From Form to Report

  • Thread starter Thread starter REVBJONES
  • Start date Start date
R

REVBJONES

How do I open a report from a form, viewing the SAME
record I'm on in the from in the report

Bennie
 
Bennie,

Presumably the report is based on the same table/query as the form. If this
is the case, then all you need to do is call the report using the OpenReport
method, and supply a filter clause based on the current primary key value.

DoCmd.OpenReport "rptMyReport", acViewPreview, , "myPrimaryKey = " &
Me!MyFormsPrimaryKey

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Back
Top