Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3014
  • Last Modified:

Access VBA Null String Date Field

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
andyb7901
Asked:
andyb7901
3 Solutions
 
peter57rCommented:
you need " " around the control name.
0
 
rockiroadsCommented:
Why dont you just do

me.TextDateForm

0
 
Arthur_WoodCommented:
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
 
Gustav BrockCIOCommented:
You could/should check for Null directly:

If IsNull(Me!TextDateFrom.Value) Then

/gustav
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now