M
Max Moor
Hi All,
I have a report that prints mailing labels. I use code like below
to setup the report before printing.
The problem is that when I form an MDE from my database for
distribution, this code throws an error. I guess it's because I'm
trying to open the report in design view. True?
If I can't open it in design view in an MDE, how do I set these
parameters? I have to ship an MDE, but I have to be able to set up this
report. Help?!?!?!!
- Max
DoCmd.OpenReport "rptLabels", View:=acViewDesign, WindowMode:
=acHidden
lHeight = rs!Height * cTwipsPerInch
lWidth = rs!Width * cTwipsPerInch
With Reports.rptRbLabels
!rtfLabel.Height = lHeight
!rtfLabel.Width = lWidth
.Detail.Height = lHeight
.Width = lWidth
!linLeft.Height = lHeight
!linRight.Height = lHeight
!linRight.Left = lWidth
!linTop.Width = lWidth
!linBottom.Width = lWidth
!linBottom.Top = lHeight
End With
With Reports("rptRbLabels").Printer
.TopMargin = cTwipsPerInch * rs!TopBottomMargins
.BottomMargin = cTwipsPerInch * rs!TopBottomMargins
.LeftMargin = cTwipsPerInch * rs!SideMargins
.RightMargin = cTwipsPerInch * rs!SideMargins
.ColumnSpacing = cTwipsPerInch * rs!HSpacing
.RowSpacing = cTwipsPerInch * rs!VSpacing
.DefaultSize = False
.ItemSizeHeight = lHeight
.ItemSizeWidth = lWidth
.ItemLayout = acPRHorizontalColumnLayout
.ItemsAcross = rs!NumLabelsH
.DataOnly = False
End With
I have a report that prints mailing labels. I use code like below
to setup the report before printing.
The problem is that when I form an MDE from my database for
distribution, this code throws an error. I guess it's because I'm
trying to open the report in design view. True?
If I can't open it in design view in an MDE, how do I set these
parameters? I have to ship an MDE, but I have to be able to set up this
report. Help?!?!?!!
- Max
DoCmd.OpenReport "rptLabels", View:=acViewDesign, WindowMode:
=acHidden
lHeight = rs!Height * cTwipsPerInch
lWidth = rs!Width * cTwipsPerInch
With Reports.rptRbLabels
!rtfLabel.Height = lHeight
!rtfLabel.Width = lWidth
.Detail.Height = lHeight
.Width = lWidth
!linLeft.Height = lHeight
!linRight.Height = lHeight
!linRight.Left = lWidth
!linTop.Width = lWidth
!linBottom.Width = lWidth
!linBottom.Top = lHeight
End With
With Reports("rptRbLabels").Printer
.TopMargin = cTwipsPerInch * rs!TopBottomMargins
.BottomMargin = cTwipsPerInch * rs!TopBottomMargins
.LeftMargin = cTwipsPerInch * rs!SideMargins
.RightMargin = cTwipsPerInch * rs!SideMargins
.ColumnSpacing = cTwipsPerInch * rs!HSpacing
.RowSpacing = cTwipsPerInch * rs!VSpacing
.DefaultSize = False
.ItemSizeHeight = lHeight
.ItemSizeWidth = lWidth
.ItemLayout = acPRHorizontalColumnLayout
.ItemsAcross = rs!NumLabelsH
.DataOnly = False
End With