Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer settings don't work for reports on one computer 1

Status
Not open for further replies.

THWatson

Technical User
Apr 25, 2000
2,601
CA
I posted this same thread in Forms and Reports.

Using Access 2003, in default 2000 file mode.

I built a database for a friend's Kiwanis club, the main user of which will be my friend, Larry.

Larry has run into a very strange problem. There is a form in which he can select names and print #10 envelopes, but the envelope report persists in showing up in Letter mode. There are some reports that persist in showing up in #10 envelope mode rather than Letter mode.
What makes this weird is that I have a code module which sets those reports to the proper printer setting upon startup of the database. So I never run into a problem.
What makes it doubly weird is that he put the program on his 3 year old laptop and even when hooked up to the same printer it runs without any problem whatsoever.

The error that he gets when he attempts to change the Page Setup in a report is "out of memory." But his computer is only a year old and he has 2 meg of RAM.

This is Larry's e-mail message to me. It's a Canon printer, 2 years old. "Everything goes well until I attempt to save the printer settings. An error box flashes up and then disappears again, covered by another saying "There is not enough memory. Close unneeded programs". Bunk I say. Nothing but the database is running, and Task manager says I'm using about 650 mb of 2 Gigs of RAM. I have rebooted and tried again, with the same result. Microsoft's error reporting routine tells me I should upgrade from Access 2000.

I have had him reinstall the printer driver, defrag, uninstall, use Windows Install Clean-up to make sure things are gone, also then put a small file on so there is no imprinting on the same sectors when he reinstalls Office. But none of this has made any difference.

Here's another message from Larry: I copied the front and back ends to the laptop, expecting to have to reconfigure the printer settings. Not so. All the reports were properly formatted. When I copied the files back to the desktop and ran it, the reports all came up with an envelope setting so I checked the default printer setting. Sure enough, it was overriding the database settings. I have reset the printer to letter several times now after running the database, and still can't figure out why it is changing.

Any ideas?

Tom
 
In my experience memory errors are usually tied to running large action queries or otherwise writing a large number of records. This is fixable by increasing the maximum number of locks Jet (the Access Database Engine) can make to a file via the registry.

Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 
4.0\maxlocksperfile


This does not sound like your problem. Is he using Access 2003 too or Access 2000? I never used Access 2000, but the book I read about it I believe had the printer changed before each printer is run. Is it possible that Access 2000 is changing the Default pritner settings instead of the report settings?
 
lameid
I'll have a look at the link.

He's using Access 2000. I use Access 2003. You might be right. But the interesting thing is that when he switches from his desktop and uses his laptop (still with 2000 and the same Canon printer) things work perfectly.

Here's the module I have to set the printer settings for #10 envelopes. Until recently I used Access 2000 and this worked perfectly. It was a different database entirely, but that shouldn't, I don't think, make a difference.
Code:
Option Compare Database
Option Explicit

Type str_DEVMODE
   RGB As String * 94
End Type

Type type_DEVMODE
   strDeviceName As String * 16
   intSpecVersion As Integer
   intDriverVersion As Integer
   intSize As Integer
   intDriverExtra As Integer
   lngFields As Long
   intOrientation As Integer
   intPaperSize As Integer
   intPaperLength As Integer
   intPaperWidth As Integer
   intScale As Integer
   intCopies As Integer
   intDefaultSource As Integer
   intPrintQuality As Integer
   intColor As Integer
   intDuplex As Integer
   intResolution As Integer
   intTTOption As Integer
   intCollate As Integer
   strFormName As String * 16
   lngPad As Long
   lngBits As Long
   lngPW As Long
   lngPH As Long
   lngDFI As Long
   lngDFr As Long
End Type

Public Function SetEnvelope(strName As String)
   Dim rpt As Report
   Dim strDevModeExtra As String
   Dim DevString As str_DEVMODE
   Dim DM As type_DEVMODE

   On Error GoTo SetEnvelope_Error

DoCmd.Echo False
DoCmd.OpenReport strName, acDesign 'Opens report in Design view.

Set rpt = Reports(strName)

If Not IsNull(rpt.PrtDevMode) Then
   strDevModeExtra = rpt.PrtDevMode
   DevString.RGB = strDevModeExtra
   LSet DM = DevString
   DM.lngFields = DM.lngFields Or DM.intOrientation 'Initialize fields.
   DM.intPaperSize = 20 '#10 Envelope size
   DM.intOrientation = 2 'Landscape
   LSet DevString = DM 'Update property.
   Mid(strDevModeExtra, 1, 94) = DevString.RGB
   rpt.PrtDevMode = strDevModeExtra
   DoCmd.Save acReport, strName
   DoCmd.Close acReport, strName
   
DoCmd.Echo True
End If

Set rpt = Nothing

   On Error GoTo 0
   Exit Function

SetEnvelope_Error:

    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure SetEnvelope of Module ModuleForSetting#10Envelopes"

End Function

We can load 2003 on his desktop and see what happens.

Thanks for the reply!

Tom
 
Based on your code, if it runs you shouldn't have a problem between versions. The fact the same version works on another machine or has in the past is a good indicator that it should work too. You might simply run windowsupdate and see if any patches fix it first. If you have a copy of Access 2003 laying around, that can't hurt either.
 
Thanks, lameid

I will try putting 2003 on his computer and see what happens.

Tom
 
Same Canon driver version on both computers ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV
Yes. Larry has the latest driver for both printers.

Tom
 
It appears that an interesting situation has been resolved.

I had Larry install Office 2003 and now things are working properly, and the settings so far seem to be holding.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top