PC Review


Reply
Thread Tools Rate Thread

How to determine if a user has entered a value in a field on a form

 
 
Chrisso
Guest
Posts: n/a
 
      23rd Jan 2007
Hi All

How can I determine if a user has entered a value in a field on a form?

I have a field which is just a text box which sits on a field in a
table. I want my VB code to check whether anything has been entered by
the user as an interim check - I do more secure checking with the field
details in the table of course.

I have tried:
Me.MyField = ""
Me.MyField Is Nothing
Me.MyField Is Null
Me.MyField = Nul
and even tried Len on Me.MyField - all to no avail.

This should be easy - what am I missing? Thanks for any and all help.

Chrisso

 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      23rd Jan 2007
If IsNull(Me.MyField) Then
' MyField is empty
End If

or (my preference)

If Len(Me.MyField & vbNullString) = 0 Then
' MyField is empty
End If


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Chrisso" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All
>
> How can I determine if a user has entered a value in a field on a form?
>
> I have a field which is just a text box which sits on a field in a
> table. I want my VB code to check whether anything has been entered by
> the user as an interim check - I do more secure checking with the field
> details in the table of course.
>
> I have tried:
> Me.MyField = ""
> Me.MyField Is Nothing
> Me.MyField Is Null
> Me.MyField = Nul
> and even tried Len on Me.MyField - all to no avail.
>
> This should be easy - what am I missing? Thanks for any and all help.
>
> Chrisso
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I require a form field have data entered before next field Marsha K Microsoft Word Document Management 1 17th Dec 2009 05:46 PM
Re: Return a value entered in a sub form field to a field in main KARL DEWEY Microsoft Access Forms 1 18th Aug 2009 03:42 PM
Connect field on form to data entered on another form field =?Utf-8?B?QmVhbWVycw==?= Microsoft Access 1 21st Aug 2006 04:35 PM
Can you show the Description entered for each Table Field when you click in a Form Field ? Will Microsoft Access 11 31st Dec 2005 02:46 AM
Populate one field in a form based on value entered in other field Tracey Microsoft Access Forms 2 26th May 2005 01:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:52 PM.