Printing report from print preview with ribbon

jyrilepisto

New member
Local time
, 00:54
Joined
Apr 19, 2014
Messages
6
I have report that i have in preview. In that report i have ribbon that has buttons close and print. Close works fine, with print it goes ok but when "printer selection" comes, i try to change printer it informs that not enough memory. All this code that is in ribbon buttons is in VBA.

What could be the reason for memory stuff or how could this be made that this inform wouldn´t come.

Code below:
Sub EnnakkoMyButtonCallbackOnAction(control As IRibbonControl)

Select Case control.ID
Case "MyBtn1"
DoCmd.OpenReport "Tuotanto Ennakko", acViewPreview
DoCmd.RunCommand acCmdPrint
Case "MyBtn2"
DoCmd.OpenForm "TuotantoEnnakko", acNormal, "", "", acEdit, acNormal
DoCmd.Close acReport, "Tuotanto Ennakko"
End Select
End Sub


Thank you for advance.
 
Not enough information! What exactly is the error message?

Have you tried it on a new database?
 
I haven´t tryed in new db. Error that comes is:
There isn´t enough menory to perform this operation. Close unneeded programs and try the operation again.

If i chooce Print to file, it "prints" it to file but if i try to change printer in menu it gives that error.
 
Is there a chance the message is correct? Is the report giant or full of images, or is the printer particularly old?

I have seen that message appear in various situations, but in the past doing a compact and repair on both the Front and Back of the database tended to get rid of it, so that may help here too.
 
Ok, i just change default printer to SnagIt, at least in Print, it opens the SnagIt and open the report in there. So there is something only problem with printer options. Thank you for this.
 
So why not go ahead and Compact & Repair and see if it helps. And also set your report to return just 1 record and try printing it with just the 1 record. Finally, test it on a new db. Tell us all three results.
 

Users who are viewing this thread

Back
Top Bottom