473,804 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_na me1 = 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 2288
Try:
If IsNull(txt_name 1) 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********@opt usnet.com.au> wrote in message
news:3f******** *************** @news.optusnet. com.au...


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_na me1 = 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*********@Se eSig.Invalid> wrote in message
news:3f******** **************@ freenews.iinet. net.au...
Try:
If IsNull(txt_name 1) 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********@opt usnet.com.au> wrote in message
news:3f******** *************** @news.optusnet. com.au...


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_na me1 = 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
13598
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 dot org
8
3953
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 this line: Set rs = db.OpenRecordset("SELECT ID FROM Contacts WHERE (" & sWhere & ");") Contacts being the main table. I am using access 2003 The error message states that there are; Too few parameters. Expected 1 I have no idea how to...
1
4673
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, 2006 than it will ask me for check ur entry date but wen i fill form that time date is oct 30, 2006 so how to solve this problem ? how to check date with server date? it is not compulsary that system date by which i am filling form date is same...
44
10243
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
11657
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 Gun_Number (assigned gun number by operations)
5
1305
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 has a date). Also, sometimes the check box may have to be checked when a date is in one field or another field (or like 5 fields). When there is no date in the field or any of the fields, the check box should not be checked. Alternatively, would I...
2
6747
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 I' using the leave event. Right now I am creating a 'leave' sub for each of the fields. However, I'd like to simplify that and just call the name of a function and plug the field name as a variable and be done. In other words, I would like...
3
8796
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 the work is completed, along with a date text box to indicate when the work was completed. There is also a check box and corresponding date field in the main form to indicate when the entire request is completed. I'm trying to create an event...
1
1535
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 be ticked. I am quite new to access to please only easy solutions Many Thanks
2
1931
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 populated with an independent date when the end-user clicks on each of the 3 check boxes. CB_STARTED STARTED_DATE CB_COMPLETED COMPLETED_DATE
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10351
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.