Re: Detail Height



Hello

I get Sample of Leban that show diffrent setting for the text on Report
Such as "Lastname, Firstname"
Well, I have module that will make few raw of post "strLast" when the text
be more than 18.

Which mean as this post example:

strLast = "Inställningarna bör matcha de inställningar som
nätverksadministratören eller Internet-leverantören angett."

So the module will change the form of text and make raw inside it.
And raw will not be so long raw as this:

strLast = "Inställningarna bör & VbCr & matcha de inställningar som & VbCr &
nätverksadministratören & VbCr & eller Internet-leverantören & VbCr & angett."

Now the result after module looks as this:

strLast = "Inställningarna bör
matcha de inställningar som
nätverksadministratören
eller Internet-leverantören
angett."

And after this text will follow [Firstname] with diffrent option As Leban
sample.

Well, now when I print strLast, so Detail didn't understand How much Hieght
needs to make space for [strLast] post. Because Detail know just TextBox
hieght.

And my question is: I nead calculate how many raw (VbCr) is on "strLast" and
then make empty TextBox and give it Hieght to let Detail understand that on
courrent post which needs more Hieght space.

And my example code, do the hieght, but not on corrent post. Result view on
next post.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim Number, Words, TheRaw As Integer

TheRaw = 0
Number = Len(strLast) ‘strLast data coms from VB print

For Words = 1 To Number Step 1
If Left(Mid(strLast, Words), 1) = vbCr Then
TheRaw = TheRaw + 1
End If
Next Words

If Not TheRaw = 0 Then
Me.txtGrow.Height = 500 * TheRaw
End If
End Sub

Do you have any ide how fix it ?

Lots of thanks for reading my question.

.


Loading