If Statement for Memo Field

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I have a memo field on my form named Job with it's control source set to Job
Description
On the main forms current event is the below code. I want the Label368 to be
visible if the memo field says None in it, else not visible.
Do I need to set the default value of the memo field to =None ?
The label368 is set to Not Visible by default.
What am I doing wrong? The Label368 is showing all the time.


If ([Job Description]) = "None" Then
Label368.Visible = True
Else:
Label368.Visible = False
End If
 
I have a memo field on my form named Job with it's control source set to Job
Description
On the main forms current event is the below code. I want the Label368 to be
visible if the memo field says None in it, else not visible.
Do I need to set the default value of the memo field to =None ?
The label368 is set to Not Visible by default.
What am I doing wrong? The Label368 is showing all the time.

If ([Job Description]) = "None" Then
Label368.Visible = True
Else:
Label368.Visible = False
End If

It's the Form's Control value you need to assess, not the field value.
You don't need the colon after Else.

If the user can enter data into the Job control, then you should place
the same code in the Job AfterUpdate event as well as the Current
event.

If [Job] = "None" Then
Label368.Visible = True
Else
Label368.Visible = False
End If

You could simplify this to simply:
Label368.Visible = [Job] = "None"

What do you wish to happen if the memo field is Null?
 
Back
Top