Report setup in an MDE???

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
 

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