|
相信不少朋友见过下面的代码,它可以自动为报表内容增加可自适应大小的方框。但是当在报表主体增加一分页符时,下面的代码就会出现“对象不支持的属性或方法”的错误提示,我百思不得其解,请高手指点!
Private Sub 主体_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer
intLineMargin = 60
For Each CtlDetail In Me.Section(acDetail).Controls
With CtlDetail
If CtlDetail.name <> "Memo" Then
Me.Line ((.Left + .Width + intLineMargin), 1)-(.Left + .Width + _
intLineMargin, Me.Height)
End If
End With
Next
With Me
Me.Line (1, 1)-Step(.Width, .Height), 1, B
End With
Set CtlDetail = Nothing
End Sub
|
|