Hathman
01-04-2011, 12:35 PM
I have done this before in forms but not on reports, however, everywhere I've searched online says it can be done. Am I doing something wrong? The error message says: "Run-time error '2101' The setting you entered isn't valid for this property."
Here is my code. I highlighted the text in red where it crashes. The variable NextTopLabel evaluates to 3018 twips so I can't seem to understand where the problem is.
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim NextTopLabel As Double
Dim NextTopSection As Double
Dim TinySpace, SmallSpace, MediumSpace, BigSpace As Double
TinySpace = 0.0104 * 1440
SmallSpace = 0.0319 * 1440
MediumSpace = 0.0834 * 1440
BigSpace = 0.1569 * 1440
NextTopLabel = 0.1979 * 1440
NextTopLabel = NextTopLabel + SmallSpace + subrptAttendee4.Height + SmallSpace + subrptAttendee7.Height + BigSpace + (0.1875 * 1440) + BigSpace
NextTopSection = NextTopLabel + TinySpace
If Forms!MAIN!chkTollgate = False Then
Me!lblRemediation.Top = NextTopLabel
Me!subrptRemediation.Top = NextTopSection
NextTopLabel = NextTopLabel + Me!lblRemediation.Height + MediumSpace
NextTopSection = NextTopLabel + TinySpace
End If
If Forms!MAIN!chkRemediation = False Then
Me!lblFollowUp.Top = NextTopLabel
Me!subrptFollowUp.Top = NextTopSection
NextTopLabel = NextTopLabel + Me!lblFollowUp.Height + MediumSpace
NextTopSection = NextTopLabel + TinySpace
End If
End Sub
Here is my code. I highlighted the text in red where it crashes. The variable NextTopLabel evaluates to 3018 twips so I can't seem to understand where the problem is.
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim NextTopLabel As Double
Dim NextTopSection As Double
Dim TinySpace, SmallSpace, MediumSpace, BigSpace As Double
TinySpace = 0.0104 * 1440
SmallSpace = 0.0319 * 1440
MediumSpace = 0.0834 * 1440
BigSpace = 0.1569 * 1440
NextTopLabel = 0.1979 * 1440
NextTopLabel = NextTopLabel + SmallSpace + subrptAttendee4.Height + SmallSpace + subrptAttendee7.Height + BigSpace + (0.1875 * 1440) + BigSpace
NextTopSection = NextTopLabel + TinySpace
If Forms!MAIN!chkTollgate = False Then
Me!lblRemediation.Top = NextTopLabel
Me!subrptRemediation.Top = NextTopSection
NextTopLabel = NextTopLabel + Me!lblRemediation.Height + MediumSpace
NextTopSection = NextTopLabel + TinySpace
End If
If Forms!MAIN!chkRemediation = False Then
Me!lblFollowUp.Top = NextTopLabel
Me!subrptFollowUp.Top = NextTopSection
NextTopLabel = NextTopLabel + Me!lblFollowUp.Height + MediumSpace
NextTopSection = NextTopLabel + TinySpace
End If
End Sub