A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

If Statement for Memo Field



 
 
Thread Tools Display Modes
  #1  
Old September 20th, 2004, 04:27 PM
Dave Elliott
external usenet poster
 
Posts: n/a
Default If Statement for Memo Field

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


  #2  
Old September 20th, 2004, 05:26 PM
fredg
external usenet poster
 
Posts: n/a
Default

On Mon, 20 Sep 2004 15:27:03 GMT, Dave Elliott wrote:

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?




--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering on custom date field MED Contacts 3 September 17th, 2004 03:05 PM
adding a field causes 90% of report to go away cmpgeek Setting Up & Running Reports 6 June 10th, 2004 08:47 PM
Using IIF statement in Memo Field J Cunningham Running & Setting Up Queries 5 May 26th, 2004 09:19 AM
lookup field rvmom New Users 2 May 23rd, 2004 03:06 AM
Make a field lookup dependent on the value in another field of a record? Susan A Database Design 8 May 22nd, 2004 09:10 PM


All times are GMT +1. The time now is 06:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.