Setting report margins

G

Guest

I have a report card printing application that I developed under Office 2000. It contains code that adjusts the margins for the different report card format reports based on values stored in a control table. I recently upgraded to Office XP (2002) and it stopped working. The R4 recordset contains the values for the form's top, left, and bottom margin values

Any ideas? Thanks

DoCmd.OpenReport ReportName:=Me.cboFormID.Column(1), View:=acDesign, windowmode:=acHidde
Reports(report1).Printer.LeftMargin = (R4("FormLeft") - 1) * 6
Reports(report1).Printer.TopMargin = (R4("FormTop") - 1) * 6
Reports(report1).Printer.BottomMargin = (R4("BottomMargin") - 1) * 6
DoCmd.Close objecttype:=acReport, objectname:=Me.cboFormID.Column(1), Save:=acSaveYe
 
G

Guest

After spending 2 hours on the phone with MS tech support tonight, this is the resolution we arrived at
-------------------------------------------------------------------
Type str_PRTMI
strRGB As String * 2
End Typ

Type type_PRTMI

intLeftMargin As Lon
intTopMargin As Lon
intRightMargin As Lon
intBotMargin As Lon
intDataOnly As Lon
intWidth As Lon
intHeight As Lon
intDefaultSize As Lon
intColumns As Lon
intColumnSpacing As Lon
intRowSpacing As Lon
intItemLayout As Lon
intFastPrint As Lon
intDatasheet As Lon

End Typ

Function SetMarginsToDefault(strName As String, intLMargin As Integer, intTMargin As Integer, intBMargin As Integer

Dim PrtMipString As str_PRTMI
Dim PM As type_PRTMI
Dim rpt As Repor
DoCmd.OpenReport strName, acDesig
Set rpt = Reports(strName
PrtMipString.strRGB = rpt.PrtMi
LSet PM = PrtMipStrin
PM.intLeftMargin = intLMargin ' Set margins
PM.intTopMargin = intTMargi
PM.intBotMargin = intBMargi
LSet PrtMipString = PM ' Update property
rpt.PrtMip = PrtMipString.strRG
DoCmd.Close acReport, strName, acSaveYe

End Functio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top