Subreport - Conditional Distance from Top

  • Thread starter Thread starter Alan Z. Scharf
  • Start date Start date
A

Alan Z. Scharf

Hi,

I'd like to set the distance from Top of a subreport at Runtime, depending
on the contents of a Detail field

I've tried the code below plus variations , but the effect is to blank out
the subreport entirely on the parent report for every detail record.

Is this possible to do at runtime?

Thanks.

Alan


Code
------------------------------------------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.ParCode = "PCPG" Then
Me.Controls("srptFundIDsCrosstab").Properties("Top") = 6.875
Else
'Me.Controls("srptFundIDsCrosstab").Properties("Top") = 8.5833
End If

End Sub
 
How high is your detail section? Are you using the default Scale which is
TWIPS? A twip is 1/1440 of an inch.
 
Alan said:
I'd like to set the distance from Top of a subreport at Runtime, depending
on the contents of a Detail field

I've tried the code below plus variations , but the effect is to blank out
the subreport entirely on the parent report for every detail record.

Code
------------------------------------------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.ParCode = "PCPG" Then
Me.Controls("srptFundIDsCrosstab").Properties("Top") = 6.875
Else
'Me.Controls("srptFundIDsCrosstab").Properties("Top") = 8.5833
End If

End Sub


The size and position properties are specified in twips in a
VBA procedure. I don't know what units you are specifying
above, but there are 1440 twips per inch.
 
Duane & Marshall,

Thanks very much.

I didn't know about twips.

That did the trick.

Regards,

Alan
 
Back
Top