Changing the Height of text boxes

  • Thread starter Thread starter Gal Zilberman
  • Start date Start date
G

Gal Zilberman

Hi
I need to change the height in the detail section for some records, I've
managed to do that but then when the next page comes up the height is still
changes and it refuses to go back to the original size.
For some reason the code stops working once the height has been changed
once.
Any ideas?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' Vars
Dim Count As Integer
Dim strMeName As String
' Reset Detial Section formating
For Count = 1 To 6 Step 1
strMeName = "Answer_" & Trim(Str(Count)) ' Fields Name
Me(strMeName).Height = 255 ' Normal Height
Next
' Resize font
If Me.Resize Then ' Flag to check if resizing is allowed for this line
For Count = 1 To 6 Step 1
strMeName = "Answer_" & Trim(Str(Count)) ' Fields Name
If Len(Me(strMeName)) > 20 Then
Me(strMeName).Height = 510 ' Double Height
End If
Next
End If
End Sub

thanks

Gal
 
Hi Bob
They were on 'No' but changing it didn't do anything.
As I mentioned, the section does grow, it just refuses to shrink back

Gal
 
is there a reason that you're changing the size of the control
programmatically? have you tried, instead, to set the *controls'* CanGrow
and CanShrink properties to Yes (as well as the same properties of Detail
section, which you say you've already done)?

hth
 
Hi Tina
All CanShrink Properties were set to Yes but it still didn't work.
BUT this got me thinking again, on a little thing that I missed. I forgot to
reset the Detail section back to it's original size, I only resized the Text
box.

So I just needed this little line added
Me.Detail.Height = 0.478

Thank you for that, now it's working fine, and I feel stupid.

Gal
 
Back
Top