My Assistant
![]() ![]() |
|
|
Feb 3 2006, 03:38 AM
Post
#1
|
|
|
UtterAccess Addict Posts: 105 |
i have the following code for my print button:
Private Sub Workscope_Review_Report_test___PRINT_Click() On Error GoTo Err_Workscope_Review_Report_test___PRINT_Click Dim stDocName As String stDocName = "Rpt: Cycle 0 Form" DoCmd.OpenReport stDocName, acNormal Exit_Workscope_Review_Report_test___PRIN: Exit Sub Err_Workscope_Review_Report_test___PRINT_Click: MsgBox Err.Description Resume Exit_Workscope_Review_Report_test___PRIN End Sub this is good but does not give me an option to select which printer i would like to send to. how to i make the print dialog box appear when this button is pressed? |
|
|
|
Feb 3 2006, 04:21 AM
Post
#2
|
|
|
New Member Posts: 13 From: Leek, UK |
DoCmd.RunCommand acCmdPrint
|
|
|
|
Feb 3 2006, 04:54 AM
Post
#3
|
|
|
UtterAccess Addict Posts: 105 |
thanks for the reply. i like the avatar/profile pic. smoke me a kipper i'll be back for breakfast (IMG:http://www.utteraccess.com/forum/style_emoticons/default/wink.gif)
whereabouts do i put the 'DoCmd.RunCommand acCmdPrint' code? i tried adding it after 'DoCmd.OpenReport stDocName, acNormal' but this still prints to my default printer before promoting me to print again i tried replacing 'DoCmd.OpenReport stDocName, acNormal' with 'DoCmd.RunCommand acCmdPrint' but that just prints my form not the report |
|
|
|
Feb 3 2006, 04:57 AM
Post
#4
|
|
|
UtterAccess VIP Posts: 7,232 From: Belgium |
Check this MS KB Article => How to automate the process of selecting the printer for a report in Microsoft Access
HTH Greetz from Belgium (IMG:http://www.utteraccess.com/forum/style_emoticons/default/compute.gif) Luc aka Kuifjexx |
|
|
|
Feb 3 2006, 04:59 AM
Post
#5
|
|
|
New Member Posts: 13 From: Leek, UK |
you should have something like this.
docmd.openreport "report name", acviewpreview docmd.runcommand accmdprint docmd.close That will open your report in preview mode, show the print dialog box and then close the report when you either print or cancel the print dialog box. |
|
|
|
Feb 3 2006, 05:17 AM
Post
#6
|
|
|
UtterAccess Addict Posts: 105 |
kuifjexx, thanks for the link, looks useful!
stimpo, works perfectly, removed the last line 'docmd.close' so the report doesnt close after print or cancel thanks for the help (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif) |
|
|
|
Feb 3 2006, 06:10 AM
Post
#7
|
|
|
UtterAccess VIP Posts: 7,232 From: Belgium |
Glad we could help you
Greetz from Belgium (IMG:http://www.utteraccess.com/forum/style_emoticons/default/compute.gif) Luc aka Kuifjexx |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 22nd May 2013 - 01:30 PM |