Print the results of a query with a Cmd button

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.
 
R

Reggie

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
 

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