Print Button (1 Viewer)

Gismo

Registered User.
Local time
Today, 04:44
Joined
Jun 12, 2017
Messages
1,298
Hi All,

I have a few print buttons for a few reports on a print menu

When the user clicks on print, instead of directly printing the report, i want the printer options screen to open first and then the user can select ok to print

Please could you advise if possible

1620720856311.png
 

Ranman256

Well-known member
Local time
Yesterday, 21:44
Joined
Apr 9, 2015
Messages
4,337
open the report in PREVIEW mode:
docmd.openreport "rMyReport",acViewPreview

then the user can print it if needed.
 

moke123

AWF VIP
Local time
Yesterday, 21:44
Joined
Jan 11, 2013
Messages
3,915
You can also put a command button on your report (in report view) and in the buttons properties set the button to only show on screen(under format, at bottom, says "Display when")
In the code for the button you use - DoCmd.RunCommand acCmdPrint. This will bring up the print dialog.
 

Gismo

Registered User.
Local time
Today, 04:44
Joined
Jun 12, 2017
Messages
1,298
Hi
open the report in PREVIEW mode:
docmd.openreport "rMyReport",acViewPreview

then the user can print it if needed.
,

Thank you for the reply.

I have my ribbon hidden so the user will not be able to see the print button

1620733567921.png


So I only want them to see the below if that is possible? If i understand you correctly

1620733633384.png
 

Gismo

Registered User.
Local time
Today, 04:44
Joined
Jun 12, 2017
Messages
1,298
You can also put a command button on your report (in report view) and in the buttons properties set the button to only show on screen(under format, at bottom, says "Display when")
In the code for the button you use - DoCmd.RunCommand acCmdPrint. This will bring up the print dialog.
Hi,

I would rather not edit any of my reports to be able to show a button as there are quite a few different reports

I would like to only see the below

1620733758799.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:44
Joined
May 7, 2009
Messages
19,231
do you show your report on print preview?
if you have not disabled the Default menu, you can Right-Click on the report and
the Print option is there.
 

Gismo

Registered User.
Local time
Today, 04:44
Joined
Jun 12, 2017
Messages
1,298
do you show your report on print preview?
if you have not disabled the Default menu, you can Right-Click on the report and
the Print option is there.
No I dont show report in print view, print button prints directly to printer, but the users are working on a remote desktop so I want them to be able to select the printer they want to print to depending on the area division they are working from

I would be great if the print screen could pop up before the print is sent to the default printer
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:44
Joined
May 7, 2009
Messages
19,231
you open the report first, (hidden) then
issue the command

docmd.RunCommand acCmdPrint

then close the report.
 

Gismo

Registered User.
Local time
Today, 04:44
Joined
Jun 12, 2017
Messages
1,298
you open the report first, (hidden) then
issue the command

docmd.RunCommand acCmdPrint

then close the report.
Below is the code I used

DoCmd.OpenReport "CS Orders - Project", acViewNormal, "", "", acHidden
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "CS Orders - Project"

It Hides the report, shows 2 pages printing
then shows the print menu
when click on op on print screen, the form which the print btn is located is the printed over 108 pages
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:44
Joined
May 7, 2009
Messages
19,231
you open it "acViewPreview"

DoCmd.OpenReport "CS Orders - Project", acViewPreview, , , acHidden
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "CS Orders - Project"
 

Gismo

Registered User.
Local time
Today, 04:44
Joined
Jun 12, 2017
Messages
1,298
you open it "acViewPreview"

DoCmd.OpenReport "CS Orders - Project", acViewPreview, , , acHidden
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "CS Orders - Project"
Sorry, yes, ACViewPreview

After ok on the print form, the form which the button is located on is printed, over 108 pages

not the actual report

So the 2 page report prints
the print menu pops up
then it prints the 108 page form

the actual report does not print
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:44
Joined
May 7, 2009
Messages
19,231
ok your report should be "pop-up (in design view, Others->Pop up: Yes)

DoCmd.OpenReport "CS Orders - Project", acViewPreview
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "CS Orders - Project"
 

Gismo

Registered User.
Local time
Today, 04:44
Joined
Jun 12, 2017
Messages
1,298
ok your report should be "pop-up (in design view, Others->Pop up: Yes)

DoCmd.OpenReport "CS Orders - Project", acViewPreview
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "CS Orders - Project"
Wow, amazing, thank you :)

Private Sub CSOrdersPrint_Click()
On Error GoTo CSOrdersPrint_Click_Err

DoCmd.OpenReport "CS Orders - Project", acViewPreview, , , acHidden
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "CS Orders - Project"

CSOrdersPrint_Click_Exit:
Exit Sub

CSOrdersPrint_Click_Err:
MsgBox Error$
Resume CSOrdersPrint_Click_Exit

End Sub
 

Gismo

Registered User.
Local time
Today, 04:44
Joined
Jun 12, 2017
Messages
1,298
Hi,

For some reason the report does not print but instead it prints the form where I selected which report to print

Below is the form where I select the record that needs to print

1626691165805.png


This is my code, it does not refer to the form to be printed but a report

Please could you advise

DoCmd.SetWarnings False

DoCmd.OpenReport "DAW Sheet - Final", acViewPreview, , , acHidden
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "DAW Sheet - Final"

DoCmd.OpenQuery "Update DAW Printed", acViewNormal, acEdit
DoCmd.OpenQuery "Update DAW Printed By", acViewNormal, acEdit
DoCmd.Requery "CS Raised - Mail Sub"
DoCmd.SetWarnings True

Command33_Click_Exit:
Exit Sub

Command33_Click_Err:
MsgBox Error$
Resume Command33_Click_Exit

End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:44
Joined
May 7, 2009
Messages
19,231
try removing the acHidden
 

Users who are viewing this thread

Top Bottom