Error 2205 (default printer driver) (1 Viewer)

ajetrumpet

Banned
Local time
Today, 15:59
Joined
Jun 22, 2007
Messages
5,638
Folks,

I am getting error 2205 (default printer driver is not set up correctly) when I try to execute a Docmd.OpenReport command. Not sure why! The RS of the report is a table, and the command is written behind a switchboard button. Help! :eek:

(I can use Docmd to open any other type of object at this line, except reports, which throws this error. This is the only command behind the button)
 

Moniker

VBA Pro
Local time
Today, 15:59
Joined
Dec 21, 2006
Messages
1,567
Adam,

The Page Setup for reports is independent for each report, meaning the settings in File -> Page Setup in Report A are different than they are for Report B. Have you looked in there? Additionally, a switchboard? I'm against them as they write a ton of extraneous code "for you" (to clean up usually), and it's very possible that the switchboard has setup printer defaults that aren't accepted by your computer's printer.
 

ajetrumpet

Banned
Local time
Today, 15:59
Joined
Jun 22, 2007
Messages
5,638
Here is the code I get when using a command button wizard to open this report:
Code:
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click


    stDocName = "rpttimeclock"
    

Exit_Command1_Click:
    Exit Sub

Err_Command1_Click:
    MsgBox Err.Description
    Resume Exit_Command1_Click
    
End Sub
It doesn't write the "OpenReport" code in the procedure! I guess you're right, but I don't think the switchboard writes code that has to do with this. It writes 4 different subs, and all code is relevant to the commands that you specify in the switchboard manager.

I also opened another one of my files where I have the Doc. Command code on a button; it works fine there.
 
Last edited:

Moniker

VBA Pro
Local time
Today, 15:59
Joined
Dec 21, 2006
Messages
1,567
Out of curiosity, how would that launch a default printer driver error? It sets up a variable it never uses and then closes the sub. Have you traced through it? It sounds like something running after that code that is causing the error, so set a breakpoint and then step through it.
 

ajetrumpet

Banned
Local time
Today, 15:59
Joined
Jun 22, 2007
Messages
5,638
Moniker,

I can't step through it! That code that I posted doesn't do anything. When you push the button, nothing happens; and that's the code that the wizard creates for the "openreport" command. Strange, huh?

And, I can't step through this code either:
Code:
docmd.openreport "name"
because there's only one line!

I'm not sure where to find this stuff, but I'll look. Apparently, there is a property that is set somehow for a report object when it's created. But, I only get this error message with the DoCmd command code. Opening the report by click doesn't throw it. What do you think I should do here?
 

Moniker

VBA Pro
Local time
Today, 15:59
Joined
Dec 21, 2006
Messages
1,567
You can put a breakpoint on this line:

stDocName = "rpttimeclock"

Then you can at least step through it. If possible, can you zip up the DB so I can get what's going on here?
 

boblarson

Smeghead
Local time
Today, 13:59
Joined
Jan 12, 2001
Messages
32,059
Moniker,

I can't step through it! That code that I posted doesn't do anything. When you push the button, nothing happens; and that's the code that the wizard creates for the "openreport" command. Strange, huh?

And, I can't step through this code either:
Code:
docmd.openreport "name"
because there's only one line!

I'm not sure where to find this stuff, but I'll look. Apparently, there is a property that is set somehow for a report object when it's created. But, I only get this error message with the DoCmd command code. Opening the report by click doesn't throw it. What do you think I should do here?

Could be some corruption creeping in there Adam. You might try importing everything into a blank mdb, or accdb, file (depending on which version you are using).
 

ajetrumpet

Banned
Local time
Today, 15:59
Joined
Jun 22, 2007
Messages
5,638
If possible, can you zip up the DB so I can get what's going on here?
Moniker,

Take a look at the attached. The single line of code is under Option Button 2 on the switchboard.

Bob,

I am going to try and import this stuff into another .MDB and see what happens. Although, I do remember deleting one subroutine that was automatically created with the switchboard object. I think there were a total of 4 Subs that came with it. I erased all of the code in Sub #4, because I didn't think it was relevant. Could this be the problem? I don't see how, but maybe I'll make another and see if that code, when included, makes a difference...
 
Last edited:

Moniker

VBA Pro
Local time
Today, 15:59
Joined
Dec 21, 2006
Messages
1,567
Option 2 is "Print Current Week's Timecard (sic)". Two things:

1) Time card is two words.

2) I click it and it works just fine.

In fact, here's the printout:



You know what I'm starting to think? Have you tried just reinstalling the printer drivers? My printer is a seven year old laser printer (Lexmark Optra E312L) and the drivers are probably close to as old.

The issue was that this one report would cause a printer driver issue, correct? Well, I can't reproduce, but I do have the webspace to show the world that the printout worked. ;)
 

ajetrumpet

Banned
Local time
Today, 15:59
Joined
Jun 22, 2007
Messages
5,638
Moniker,

What the heck are you talking about!? The point here is not to print the stupid report! I want to know why, with an OpenReport command, it automatically prints. WHY? I just want to OPEN it, not print it! Do you have any useful knowledge on the actual issue at hand? :)
 

Moniker

VBA Pro
Local time
Today, 15:59
Joined
Dec 21, 2006
Messages
1,567
Moniker,

What the heck are you talking about!? The point here is not to print the stupid report! I want to know why, with an OpenReport command, it automatically prints. WHY? I just want to OPEN it, not print it! Do you have any useful knowledge on the actual issue at hand? :)

My bad... forgot there was an actual issue. Give me two minutes for your newb question and I'll humiliate you more. Or not. Or something. :p
 

Moniker

VBA Pro
Local time
Today, 15:59
Joined
Dec 21, 2006
Messages
1,567
As promised...

Change this:

DoCmd.OpenReport "rpttimeclock", acViewNormal

To this:

DoCmd.OpenReport "rpttimeclock", acViewPreview

I'll send a PM with my address for the check. HA! ;)

Straight outta (not Compton) but Access Help:

The OpenReport method carries out the OpenReport action in Visual Basic.

expression.OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs)
expression Required. An expression that returns a DoCmd object.

ReportName Required Variant. A string expression that's the valid name of a report in the current database. If you execute Visual Basic code containing the OpenReport method in a library database, Microsoft Access looks for the report with this name, first in the library database, then in the current database.

View Optional AcView. The view to apply to the specified report.

AcView can be one of these AcView constants.
acViewDesign
acViewNormal default Prints the report immediately.
acViewPivotChart Not supported.
acViewPivotTable Not supported.
acViewPreview

Moniker 1, Adam 0.

Next.
 
Last edited:

ajetrumpet

Banned
Local time
Today, 15:59
Joined
Jun 22, 2007
Messages
5,638
Do you need help creating an invoice? I'll tell you what:

I'll create the invoice for you to send for your services, and that'll pay for your services OK? Then, the next time you help someone, you'll have the invoice ready to send out. :)
 

Moniker

VBA Pro
Local time
Today, 15:59
Joined
Dec 21, 2006
Messages
1,567
No worries. Glad it was that simple (after all this). And remember, I said in the very first response that I don't like switchboards because they write code for you, and if you don't know coding well, crap like this happens. I'm not accusing you of anything here as it turns out it was something a little strange (the fact that acViewNormal means print for reports and something else for everything else is silly), but it was sitting right there in the Access Help file.

Anyway, get on with getting on, and thanks for playing. Remember, four whammies and you're out!
 

Users who are viewing this thread

Top Bottom