469,587 Members | 2,659 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,587 developers. It's quick & easy.

how to check date ?



Hi there, how are you?

I have question, assume I have a text box and gave it a format
date&time, how can I check when it is empty or not empty I use the code as

if frm_form!txt_name1 = Null then
msgbox "1"
else
msgbox "2"
end if

I only have a message 2 pop up, am I doing a wrong way? any help would
be great, thank you for your time
--------------------------------------------------------------------------


Nov 12 '05 #1
2 2117
Try:
If IsNull(txt_name1) Then

Nothing is ever equal to null. For an explanation, see:
Common errors with Null
at:
http://allenbrowne.com/casu-12.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tu Quach" <qu********@optusnet.com.au> wrote in message
news:3f***********************@news.optusnet.com.a u...


Hi there, how are you?

I have question, assume I have a text box and gave it a format
date&time, how can I check when it is empty or not empty I use the code as

if frm_form!txt_name1 = Null then
msgbox "1"
else
msgbox "2"
end if

I only have a message 2 pop up, am I doing a wrong way? any help would be great, thank you for your time

Nov 12 '05 #2
just a guess, try testing for the value being a zero length string, which is
a different value than Null

if Len(txtBOX) = 0 or isnull(txtBOX) then
John Bickmore
www.BicycleCam.com
www.Feed-Zone.com

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:3f**********************@freenews.iinet.net.a u...
Try:
If IsNull(txt_name1) Then

Nothing is ever equal to null. For an explanation, see:
Common errors with Null
at:
http://allenbrowne.com/casu-12.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tu Quach" <qu********@optusnet.com.au> wrote in message
news:3f***********************@news.optusnet.com.a u...


Hi there, how are you?

I have question, assume I have a text box and gave it a format
date&time, how can I check when it is empty or not empty I use the code as
if frm_form!txt_name1 = Null then
msgbox "1"
else
msgbox "2"
end if

I only have a message 2 pop up, am I doing a wrong way? any help

would
be great, thank you for your time


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Mike Charney | last post: by
2 posts views Thread by John Smith | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.