Solved

Access VBA Null String Date Field

Posted on 2007-11-19
4
2,966 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
4 Comments
 
LVL 77

Expert Comment

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

Accepted Solution

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

me.TextDateForm

0
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 200 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 49

Assisted Solution

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

If IsNull(Me!TextDateFrom.Value) Then

/gustav
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

770 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