report from a single record displayed on the form

  • Thread starter Thread starter Al Heyne
  • Start date Start date
A

Al Heyne

Hi all, any help on building a report based on a single
record displayed in my form? I'd like to put a button on
the form that sends a report for the record currently
shown on the form via email to my client.
Thanks in advance
 
Al Heyne said:
Hi all, any help on building a report based on a single
record displayed in my form? I'd like to put a button on
the form that sends a report for the record currently
shown on the form via email to my client.
Thanks in advance

The DoCmd.OpenReport method has an optional WHERE argument which uses the
same syntax as the WHERE clause in a query, but without the word "WHERE".
You would use that to apply a filter to the report as it is opened that
only returns the record currently being viewed on the form

For example; if both the form and report included a numeric Primary Key
named "ID" then you could use...

DoCmd.OpenReport "ReportName",,,"[ID] = " & Me.ID
 
Back
Top