Print Current Record From Form

  • Thread starter eschlep via AccessMonster.com
  • Start date
E

eschlep via AccessMonster.com

I am trying to print a form and I created a button that takes the form to a
report however it leaves out all of the subforms in the form. My code for
the button is
Private Sub Print_Click()

Dim strReportName As String
Dim strCriteria As String

If NewRecord Then
MsgBox "This record contains no data. Please select a record to print
or Save this record." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "LNREVIEWQ33"
strCriteria = "[Field2]= '" & Me![Field2] & "'"


DoCmd.OpenReport strReportName, acViewPreview, , strCriteria

End If
End Sub

Thanks
 
P

pietlinden

If you have subforms in your main form and you want all that in your
report, you can create subreports that mirror recreate those for
printout and then just pass a filter in the Open event of the report.
 
E

eschlep via AccessMonster.com

Would this have the form and subform in the same report. How would i do this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top