Printing report based on current record of form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wanted to print a form, so I created a report that looked similar to the
form.
I've created a command button on the form where I want it to print the
report based on the current record on the form. How can I code this into the
command button?
Thanks.
 
Answered recently. Did you do a search?


Private Sub Print_Button_Click()

If (IsNull([UserID])) Then

' Verify the key field (UserID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[UserID] =
Forms![frmSomeFormName]![UserID]"

End Sub




Rick B
 
Back
Top