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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Half page size report/ conversion issue

Status
Not open for further replies.

gearhead03

Technical User
Mar 29, 2003
147
US
I have a report that prints our invoices. We use a dot matrix tractor feed printer. The invoices are roughly 1/2 the length and the same width as standard letter paper. I just converted the database from access 97 to access 2000. I also upgraded our workstations from ME to XP. 5 computers on the network (not including the server). Now the computer that is actually hooked to the printer prints the report correctly. All the others print it as if it is a letter size invoice. I seems to remember having to go though this when I made the DB but for the life of me I can't remember how to fix it. I have went into the page setup but there isn't a 1/2 letter size or user defined. On the workstation that it prints correctly it lists as letter size.?? As usual any help is appreciated!!!

Mark A. Kale
 
Mark
First of all something to check...are all the other computers using the printer, that is hooked to the one that works properly, as their default printer?

If that doesn't correct the problem...I cannot guarantee the following, but it might be worth considering.

I had a problem with Page Setup reverting to Letter size paper, rather than using the designed #10 envelope, when updating databases on other computers. That was because the computer uses the default printer as its guide for setup.

Unfortunately, Access 2000 doesn't have a Printer property, so you have to get at the settings using PrDevMode.

Put the following in a Module. Then you can call the "SetEnvelope" function when the form driving the report is opened, or you can call it in an AutoExec macro at database startup. (rename the SetEnvelope to something else if you prefer)

Code:
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

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
End If

End Function

The above is set to print #10 envelopes, but take note of the line DM.intPaperSize = 20 '#10 Envelope size and change the value from 20 to 22.
22 is the value for a #12 envelope, which is 4.25 inches x 11 inches, which is half a page.

The other possibility would be to change the 20 to 256, as 256 is a user-defined size.

You will probably also need to change the setting in the line DM.intOrientation = 2 'Landscape from 2 to 1, to get Portrait mode.

Other than this, I don't know what to suggest.

Good luck.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top