473,396 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2264
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mike Charney | last post by:
Is there a way to check a files date and time stamp from VBA in access. I have a need check a date stamp on a file that I am importing. Thanks in advance, Mike m charney at dunlap hospital...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
1
by: shyam vashista | last post by:
i have problem in validation check for system date with server date problem::: If i change my system date as september 30, 2006 and use validation for filling form as current date as oct30,...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
5
by: starke1120 | last post by:
Im creating a check in – check out database for RF guns. I have a table that contains models. ID (primary key) Model A table that contains Gun Details ID (primary key) Model_id...
5
by: cfwillia | last post by:
Hi, I'm trying to make a Report that will show a check box as checked off if there is a date in a certain field for the given record (instead of the field in the database being yes/no, each field...
2
by: John Smith | last post by:
Hello, I have a VB.NET application with a Windows form that have several textboxes fields where I have dates entered. I would like to do a date validation check after the the field is updated, so...
3
by: jsurkin | last post by:
I have a form that lists a single work request, with an attached continuous subform that lists specific items that are part of the request. Each item in the subform has a check box to indicate when...
1
by: AP | last post by:
I am creating a database form that has a date field and a check box. When a user enters a date then I want the check box to automatically be null and if no date is entered I want the check box to...
2
by: KMEscherich | last post by:
Microsoft Access 2003 Hi there, am stuck with something that I am not sure on how to get done. I am attempting to have 3 check boxes and have 3 date fields. I need to have each date field be...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.