By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

how to check date ?

P: n/a


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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.