Clearing date Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a program that checks if a record if closed by querying the date field
in a table. If the user wants to reopen the record, I need to clear the date
field in the table. How can you clear the date field from a table. Date
field is derfined as Date.

The table is in Access 2000.
Thanks
Bob
 
BR said:
I have a program that checks if a record if closed by querying the date field
in a table. If the user wants to reopen the record, I need to clear the date
field in the table. How can you clear the date field from a table. Date
field is derfined as Date.


If it's the current record in a form, set the field to Null.

If it's only a record in a table, Execute an Update query to
set it to Null.
 
The usual way would be to make the field Not Required, and to set it to
Null.
 
I'm using VB 6.0 as a front-end. I posted here due to the Access back-end.
I've tried the following:

rs.edit
rs!ClosedDate=vbNull
rs.Update

This results in an error.
 
I'm using VB 6.0 as a front-end. I posted here due to the Access back-end.
I've tried the following:

rs.edit
rs!ClosedDate=vbNull
rs.Update

This results in an error.

Not vbNull, but Null works for me.
vbNull has a value of 1

rs.edit
rs!ClosedDate= Null
rs.Update
 
BR said:
I'm using VB 6.0 as a front-end. I posted here due to the Access back-end.
I've tried the following:

rs.edit
rs!ClosedDate=vbNull
rs.Update

This results in an error.


Assuming the field is not a Required field, that shouldn't
generate an error (even if it is the wrong value).

My object browser tells me that vbNull has a value of 1. I
don't use VB, but I would expect it to have Null as a
literal value, which is what you want to assign to the
field.

rs!ClosedDate = Null

If the date field is Required, you will not be able to
"clear" it, no matter what you try.
 
Back
Top