printer issue. urg!

adaniele

Registered User.
Local time
Today, 17:20
Joined
Jul 18, 2005
Messages
176
hi guys , i need some hlp.

I am hidding all the toolbars when a user loging into the database, with the following code:
Code:
    For i = 1 To CommandBars.Count
        CommandBars(i).Enabled = True
        MsgBox i
    Next i

The problem comes when a user select a report from the main menu. i open the report like this:
Code:
                DoCmd.OpenReport "reportname", acViewPreview, acWindowNormal

BUT because i hide the toolbars, they can not print the report.

i tryied creating a tool bar and using this code when the report is open but nothing happened:
Code:
 docmd.showtoolbar "E-Wine", actoolbaryes

In addition, i tryed adding on report_close the following code:
Code:
        vqueres = MsgBox("Do you want to print this report?", vbYesNo)
        If vqueres = vbYes Then
            DoCmd.RunCommand acCmdPrint
        End If
as a result i got an error : "run-time 2585 . This action can not be carried out while processing a form or report event"


Can somebody tell me how i can let the user print the report using vB code?

thx very much, max.
 
Last edited:
Why not print the report instead of previewing it?

Code:
DoCmd.OpenReport "ReportName", acViewNormal
 
ghudson said:
Why not print the report instead of previewing it?

Code:
DoCmd.OpenReport "ReportName", acViewNormal

your idea came to my mind, but, what about if they dont want to print it and they just want to see the report?

i want to make a flexible tool. i would like they to choose between printing and viewing.

thx, max.
 
workarround

guys, i did not solve the problem, but i found another way to do it.
i created another form where the user selects a report from a combo and then is able to press a print or a view button.

thx, max.
 

Users who are viewing this thread

Back
Top Bottom