Solved

Access VBA Null String Date Field

Posted on 2007-11-19
4
2,988 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 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 51

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

631 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