clear out a date programmatically

L

Leif

Try setting NewDate as a Variant. I don't believe Null is
valid for a date data type.
-----Original Message-----
I am trying to clear a date through VBA code in a record in my table.
I keep getting data type mismatch or invalid use of Null error
basically I am :

Dim NewDate as date
NewDate=(Me![ETA])
Forms!currentForm!ETA=NewDate

IsNull(NewDate)

Obviously there is more going on here. But my problem is
that when Me!ETA is blank I get a type mismatch error.
When I check for Null I get a Invalid use of Null error.
Any help you can offer is really appreciated because I
have corrected and overcorrected so many times now I'm
spinning!
 
M

Macy

Thanks for your help Leif, could you supply the proper syntax for setting as a variant? My brain has completely fried on this!
Thanks,Macy

Leif said:
Try setting NewDate as a Variant. I don't believe Null is
valid for a date data type.
-----Original Message-----
I am trying to clear a date through VBA code in a record in my table.
I keep getting data type mismatch or invalid use of Null error
basically I am :

Dim NewDate as date
NewDate=(Me![ETA])
Forms!currentForm!ETA=NewDate

IsNull(NewDate)

Obviously there is more going on here. But my problem is
that when Me!ETA is blank I get a type mismatch error.
When I check for Null I get a Invalid use of Null error.
Any help you can offer is really appreciated because I
have corrected and overcorrected so many times now I'm
spinning!
Thanks, Macy

.
 
G

Guest

Try replacing
Dim NewDate as date

with
Dim NewDate as Variant

The variable should now accept a null value from ETA.
-----Original Message-----
Thanks for your help Leif, could you supply the proper
syntax for setting as a variant? My brain has completely
fried on this!
Thanks,Macy

Leif said:
Try setting NewDate as a Variant. I don't believe Null is
valid for a date data type.
-----Original Message-----
I am trying to clear a date through VBA code in a
record
in my table.
I keep getting data type mismatch or invalid use of
Null
error
basically I am :

Dim NewDate as date
NewDate=(Me![ETA])
Forms!currentForm!ETA=NewDate

IsNull(NewDate)

Obviously there is more going on here. But my problem
is
that when Me!ETA is blank I get a type mismatch error.
When I check for Null I get a Invalid use of Null error.
Any help you can offer is really appreciated because I
have corrected and overcorrected so many times now I'm
spinning!
Thanks, Macy

.
.
 
M

Macy

Thank you so much! Tried it first think this morning and I'm all set!
Sometimes being self taught you miss the simlple things!
Again Thanks, Macy

Try replacing
Dim NewDate as date

with
Dim NewDate as Variant

The variable should now accept a null value from ETA.
-----Original Message-----
Thanks for your help Leif, could you supply the proper
syntax for setting as a variant? My brain has completely
fried on this!
Thanks,Macy

Leif said:
Try setting NewDate as a Variant. I don't believe Null is
valid for a date data type.
-----Original Message-----
I am trying to clear a date through VBA code in a record
in my table.
I keep getting data type mismatch or invalid use of Null
error
basically I am :

Dim NewDate as date
NewDate=(Me![ETA])
Forms!currentForm!ETA=NewDate

IsNull(NewDate)

Obviously there is more going on here. But my problem is
that when Me!ETA is blank I get a type mismatch error.
When I check for Null I get a Invalid use of Null error.
Any help you can offer is really appreciated because I
have corrected and overcorrected so many times now I'm
spinning!
Thanks, Macy

.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top