J
Jemsson
Hello
I have report that I use print by VB Event / on Format
Well, When I print so some post have more than 1 raw and that make problem
with Detail Height, cause Detail know ONLY data on TextBox.
So I made empty TextBox with name: CanGrow
I try to make own code and it works, but the problem is:
Slowly and the other problem is the result of Height shows on next post
instead on current 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
-----------------------
I know this code I created is not the best, because it take long time when
open report.
Do you have any idée to calculate how many VbCr and then make
Me.TextGrow.Hieght = ….. on only current post ?
So In this TextGrow.Height will give enough space on Detail to show that
“strLast†that prints direct from VB on report.
Lots of thanks for giving your time and read my question
I have report that I use print by VB Event / on Format
Well, When I print so some post have more than 1 raw and that make problem
with Detail Height, cause Detail know ONLY data on TextBox.
So I made empty TextBox with name: CanGrow
I try to make own code and it works, but the problem is:
Slowly and the other problem is the result of Height shows on next post
instead on current 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
-----------------------
I know this code I created is not the best, because it take long time when
open report.
Do you have any idée to calculate how many VbCr and then make
Me.TextGrow.Hieght = ….. on only current post ?
So In this TextGrow.Height will give enough space on Detail to show that
“strLast†that prints direct from VB on report.
Lots of thanks for giving your time and read my question