Hi again
HELP! Still having problems with this. I completely understand what should be happening with the code. To give more specifics I call the following function to print my continuous forms with detail sections of 8 inches x 4 inches each:
Function SetReportMarginDefault(strReportName As String)
Dim PrtMipString As str_PRTMIP
Dim PM As type_PRTMIP
Dim objRpt As Report
Dim tempPrtMip As String
DoCmd.Echo False
DoCmd.OpenReport strReportName, acDesign
Reports(strReportName).Painting = False
Set objRpt = Reports(strReportName)
PrtMipString.strRGB = objRpt.PrtMip
LSet PM = PrtMipString
'Use 1440 for inches
PM.fDefaultSize = False ' when true uses the size of the detail section in Design view, when false uses the values specified by ItemSizeWidth and ItemSizeHeight below
PM.yTopMargin = 0 ' 1440 twips = 1 inch
PM.yBottomMargin = 0
PM.xLeftMargin = 0
PM.xRightMargin = 0
PM.xItemsAcross = 1 ' Columns across = 1
PM.xRowSpacing = 0 ' the horizontal space btw detail sections
'PM.xRowSpacing = 0.25 * 1440 ' = Set 0.25 inch between columns.
PM.yColumnSpacing = 0 ' the vertical space btw detail sections
PM.xItemSizeWidth = 8 * 1440 ' width of the detail section (8 inches) in twips - 1440 twips = 1 inch
PM.yItemSizeHeight = 4 * 1440 ' height of the detail section (4 inches) in twips - 1440 twips = 1 inch
PM.rItemLayout = 1953 ' across, then down
'PM.rItemLayout = 1954 ' down, then across
LSet PrtMipString = PM
objRpt.PrtMip = PrtMipString.strRGB
'Make sure report has the focus
DoCmd.SelectObject acReport, strReportName
'Save the Report
DoCmd.DoMenuItem 7, acFile, 4, , acMenuVer70
'print the warrants
DoCmd.OpenReport strReportName, acViewNormal
CloseRpt:
DoCmd.Close acReport, strReportName
DoCmd.Echo True
End Function
BUT after printing the first page each subsequent page of details moves up slightly and is not aligned. Please I am pulling my hair out here and would really appreciate any help. Am I missing something from my code? After assigning the values am I opening/printing the report correctly?
I have tried assigning values to the top, bottom, left and right parameters but this makes no difference.
Aleathiel did you get this to work and can you suggest anything?
Thanks in advance.
Saners.