Print the results of a query with a Cmd button

  • Thread starter Thread starter Lamar
  • Start date Start date
L

Lamar

I have a cmd button when it is clicked; shows a query in
print preview. Here is the VB code the cmd button -
DoCmd.OpenQuery stDocName, acViewPreview

Instead of previewing, is there a way to just print the
query using a cmd button?

Thanks.
 
Lamar, Design a report based on the query and print the report. You can
make it look just like the query.

Private Sub cmdPreview_Click()
Dim stDocName As String
stDocName = "rptYourReport"
DoCmd.OpenReport stDocName, acNormal
End Sub
 
Back
Top