Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access VBA Null String Date Field

Posted on 2007-11-19
4
Medium Priority
?
2,999 Views
Last Modified: 2012-08-14
Hi,

Can someone tell me how I would check a text field of mine, which has an input mask of date, for null values. I usually do the following;

If Nz(Me(TextDateFrom), "") = vbNullString Then

But for some reason it is saying MS Office cant find the field "01/11/2007" (Which is the value in the field, not the field itself).
0
Comment
Question by:andyb7901
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 20311641
you need " " around the control name.
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 800 total points
ID: 20311654
Why dont you just do

me.TextDateForm

0
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 800 total points
ID: 20311856
the (...) around the field name cause that value to be evaluted, hence you are seeing 01/11/2007  rather than the name for the field.  Your code should read:

If Nz(Me.TextDateFrom, "") = vbNullString Then

AW
0
 
LVL 51

Assisted Solution

by:Gustav Brock
Gustav Brock earned 400 total points
ID: 20313597
You could/should check for Null directly:

If IsNull(Me!TextDateFrom.Value) Then

/gustav
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question