W
WorldCTZen
I need to set the height of the detail, and all the controls on the detail,
based on the contents of a textbox.
I can't just set the textbox and detail to CanGrow = true, as this will
cause gaps in a grid when the other controls don't grow at the same time.
So, I have the following:
If Len(LineItemTxt) > 58 Then
Me.Detail.Height = 480
Me.LineItemTxt.Height = 480
Else:
Me.Detail.Height = 240
Me.LineItemTxt.Height = 240
End If
(I've taken out the other conrols, as they work appropriately with the above
code.)
The problem I'm having is that the Detail will grow when it shouldn't.
In a group, if there are any records where LineItemTxt has more than 58
characters, the first Detail in the group will grow, even though THAT record
doesn't have >58 chars. Then, on the second record, the detail will return to
240 twips, and on the records that do have more than 58 characters, the
Detail will size back up to 480 twips.
I've tried this with Detail.CanGrow set to both false and true, with the
same result.
If I don't set the Detail.Height value for each detail, it will grow to
480twips with the first record to have more than 58 chars, and stay that way.
So the logic setting it to 240 Twips works.. but somehow it's being
overwritten on the first record. The odd thing is the LineItemText field is
exactly the right height each time, so it's not the logic.. Some special
function of the Detail is at work here.. Any suggestions?
based on the contents of a textbox.
I can't just set the textbox and detail to CanGrow = true, as this will
cause gaps in a grid when the other controls don't grow at the same time.
So, I have the following:
If Len(LineItemTxt) > 58 Then
Me.Detail.Height = 480
Me.LineItemTxt.Height = 480
Else:
Me.Detail.Height = 240
Me.LineItemTxt.Height = 240
End If
(I've taken out the other conrols, as they work appropriately with the above
code.)
The problem I'm having is that the Detail will grow when it shouldn't.
In a group, if there are any records where LineItemTxt has more than 58
characters, the first Detail in the group will grow, even though THAT record
doesn't have >58 chars. Then, on the second record, the detail will return to
240 twips, and on the records that do have more than 58 characters, the
Detail will size back up to 480 twips.
I've tried this with Detail.CanGrow set to both false and true, with the
same result.
If I don't set the Detail.Height value for each detail, it will grow to
480twips with the first record to have more than 58 chars, and stay that way.
So the logic setting it to 240 Twips works.. but somehow it's being
overwritten on the first record. The odd thing is the LineItemText field is
exactly the right height each time, so it's not the logic.. Some special
function of the Detail is at work here.. Any suggestions?