You need to get the length of the value in the field (assuming this is a
text field). FieldSize would be the value you set for the field in the table
design or the size of a memo field in a recordset object.
If Len(Me!CertDesc ription) > 100 Then
You may also be able to use the following if the field is a memo field.
If Me.Recordset.Ce rtDesription.Fi eldSize > 100 Then
Testing this, it will work in a form, but the Recordset object isn't
available for access this way in a report. However, the Len() function and
FieldSize properties will not necessarily return the same value. The
FieldSize property will tell you how bytes the memo field is has, not how
many characters are in the field. This will probably be twice the number of
characters, even with Unicode Compression set to Yes in the table design. In
Access 97, they may be the same.
--
Wayne Morgan
MS Access MVP
<dk*******@yaho o.com> wrote in message
news:11******** *************@g 43g2000cwa.goog legroups.com...
I have an Access Report that I am trying to enter an "If Statement"
that when a certain field exceeds a certain number of lines or a
certain number of characters that field is not visible and another
field on a second page becomes visible. Following is my "If Statement"
that doesn't work. My issue is how to refer to the number of lines or
the field size in the "If Statement".
If Me!CertDescript ion.FieldSize > 100 Then
Me.Label140.Vis ible = True
Me.Line143.Visi ble = True
Me.Text141.Visi ble = True
Me.Label145.Vis ible = True
Me.CertDescript ion.Visible = False
Else
Me.Label140.Vis ible = False
Me.Line143.Visi ble = False
Me.Text141.Visi ble = False
Me.Label145.Vis ible = False
Me.CertDescript ion.Visible = True
End If
Thank you