C
ccw
MSAccess 2003
This sounds so simple - what am I doing wrong?
My simple report has several fields arranged vertically in the detail
section.
Some of the fields may have null or zero-length string values.
I have the Can Shrink property of each control set to "Yes".
In the code for the Detail_Format event, I have the following type of logic,
replicated for each control:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Controls("Description").Visible = True
If Me.Controls("Background").Text = "" Then
Me.Controls("Background").Visible = False
End If
'Same thing for next control....
'Same thing for next control....
End Sub
(I am writing the code because the usual property settings do not appear to
workin this case, for this data, which sounds strange.)
In the debugger I can see that the Visible property is set to False when the
text value of the control is "".
WHAT I DO NOT GET IS why the print preview still shows vertical space where
there is a shrinkable invisible control???
Would a non-printable character in the field cause peculiar behavior? Would
it test equal to "" if it were a linefeed, CR, etc? I have cannot detect any
character at all, len(control.text) returns 0. In the debugger, the
control's value, as a variant, is null.
Thanks in advance. -CCW
This sounds so simple - what am I doing wrong?
My simple report has several fields arranged vertically in the detail
section.
Some of the fields may have null or zero-length string values.
I have the Can Shrink property of each control set to "Yes".
In the code for the Detail_Format event, I have the following type of logic,
replicated for each control:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Controls("Description").Visible = True
If Me.Controls("Background").Text = "" Then
Me.Controls("Background").Visible = False
End If
'Same thing for next control....
'Same thing for next control....
End Sub
(I am writing the code because the usual property settings do not appear to
workin this case, for this data, which sounds strange.)
In the debugger I can see that the Visible property is set to False when the
text value of the control is "".
WHAT I DO NOT GET IS why the print preview still shows vertical space where
there is a shrinkable invisible control???
Would a non-printable character in the field cause peculiar behavior? Would
it test equal to "" if it were a linefeed, CR, etc? I have cannot detect any
character at all, len(control.text) returns 0. In the debugger, the
control's value, as a variant, is null.
Thanks in advance. -CCW