Hi John,
Yes, there is just one space in the ClassCode field if there isn't an
actual classcode.
To explain better, I'm trying to do something like this:
If IsNull(Me.[ClassCode]) Then
Me.ClassLabel.Visible = False
Me.StudentLabel.Visible = False
Else
Me.ClassLabel.Visible = True
Me.StudentLabel.Visible = True
End If
I don't think a Select Statement will work here.
Thanks again,
Michele
P.S. - When you get the yellow highlight on code that gives an error,
what is the best way to get more information on the cause of the error?
Ummm... that's not what you asked. It's a very reasonable question but a
DIFFERENT question.
Me.ClassLabel.Visible = (Len([ClassCode] & "") > 0)
Me.StudentLabel.Visible = (Len([ClassCode] & "") > 0)
Concatenating the value of ClassCode with a null string will give you astring
result; if ClassCode is NULL or a null string, the concatenation will be a
null string and its Length will be 0. If there is data in the classcodeits
length will be greater than 0.
--
Hi Again,
This is driving me crazy. I'm getting an error on the first line -
Me.ClassLabel.Visible = (Len([ClassCode] & "") > 0), but only when
ClassCode is a space. The error is 2427; the expression has no
value. Checking the table, there is a space in the field.
I'm now getting an error on the first line of this (with either the
first or second line). Changing the code above might not have caused
it. These errors keep popping up but I'm having trouble determining
when they happen.
' If Me.Terms <> " " Then
If IsNull(Terms) Then
Me.TermsLabel.Visible = False
Else
Me.TermsLabel.Visible = True
End If
Any ideas would be really appreciated. All the hard parts of the
application are done and it's these little things that don't display
labels when their corresponding objects are blank that I'm having
trouble with.
Thanks again,
Michele