Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print report button

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I have a command button that opens a report okay. The code is:

Private Sub Command13_Click()
DoCmd.OpenReport "TLG", acViewDesign, , , acHidden
Reports("TLG").RecordSource = Me.LP.RowSource
DoCmd.Close acReport, "TLG", acSaveYes
DoCmd.OpenReport "TLG", acViewPreview
End Sub

How can I add another button alongside that will print the report?

Many thanks
 
I have since used this:

DoCmd.OpenReport "TLG", acViewDesign, , , acHidden
Reports("TLG").RecordSource = Me.LP.RowSource
DoCmd.Close acReport, "TLG", acSaveYes
DoCmd.OpenReport "TLG"

However it does not bring up the normal print dialogue form allowing printer preferences, number of copies, select a printer. Is there anyway to do this, I don't want to use shortcut menu's if I can help it, ideally wanting the correct bit to open from my command button. Many thanks
 
You could use the menu access method.

ie: DoCmd.DoMenuItem acFormBar, 1, 12, , acMenuVer20

1 is the item in the formbar

12 is the position of the command you wish to run in the drop down list.

acmenuver20 relates to access 2003

for example the above would be the same as selecting file and print from access's menus

Help will give you more information. I don't know if this is version dependable.

Ian Mayor (UK)
Program Error
Programming is 1% coding, 50% error checking and 49% sweat as your application bombs out in front of the client.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top