A report doesn't have a "current" record.
To print the current record in a form, it's best to create a report bound to the same table or query as the form. So by itself, the report will display/print ALL records. Let's say the report is named rptData
Also, let's say that the record source of the form (and report) has a unique identifier named ID, and that this is a number field (for example an AutoNumber field).
You can create a command button cmdReport on the form with an On Click event procedure like this:
- Code: Select all
Private Sub cmdReport_Click()
If IsNull(Me.ID) Then
MsgBox "There is no current record.", vbExclamation
DoCmd.OpenReport "rptData", acViewPreview, , "ID = " & Me.ID
This will open the report in preview mode with only the current record from the form. If you prefer to print the report directly instead of previewing it, change acViewPreview to acViewNormal.