call report on record from form

L

littlebour

I can open a report from the form but I only want to see the current record
on the report, not all of them. How do I call just the one record that is
current?
 
O

Ofer

Use the open report command, and use the where condition to filter on the
current record

docmd.OpenReport "ReportName",,,"WhereCondition"
Can be
' If you filter on a number field
docmd.OpenReport "ReportName",,,"FieldNameInTable = " & FieldNameOnForm

' If you filter on a Text field
docmd.OpenReport "ReportName",,,"FieldNameInTable = '" & FieldNameOnForm & "'"
 
Top