Re: How to reset or clear a date field
- From: Martin <ironwoodcanyon@xxxxxxxxx>
- Date: Thu, 13 Aug 2009 12:21:24 -0700
On Thu, 13 Aug 2009 11:40:17 -0700, "Bob Butler" <noway@xxxxxxxxxxx>
wrote:
Your example seems to be an SQL statement. I don't know if it makes
"Martin" <ironwoodcanyon@xxxxxxxxx> wrote in message
news:vek885t39mo2dvhpe61ng0fbepv2120khu@xxxxxxxxxx
I have a MSAccess database that is created and maintained by my VB6
program. In one of the tables, there are a couple of "date" fields
(declared at the time of creation as type: dbDate). When a new record
is added to this table (by my VB6 program), these fields are ignored -
no date is put in them. Later on, various conditions in the program
update these fields with the current time and date.
I now have a situation where I want to clear this field of any data;
that is, I want it to be as it was before any time and date was stored
in it. So, my question is: what do I set this field to? Do I assign ""
to it? Or vbNull? Or what?
Update thetablename Set datefield1=null, datefield2=null
any difference but I'm not doing the updates with SQL. Here's what I'm
doing:
I have a recordset globally declared and opened. Then I execute
statements like these:
rsMainData.Edit
rsMainData.Fields("FieldA").Value = "ABCD"
rsMainData.Fields("FieldB").Value = 1234
rsMainData.Fields("DateField").Value = Now
rsMainData.Update
So, to "clear" the DateField, would I set thus:
rsMainData.Fields("DateField").Value = vbNull
.
- Follow-Ups:
- Re: How to reset or clear a date field
- From: Nobody
- Re: How to reset or clear a date field
- From: Jeff Johnson
- Re: How to reset or clear a date field
- From: Bob Butler
- Re: How to reset or clear a date field
- References:
- How to reset or clear a date field
- From: Martin
- Re: How to reset or clear a date field
- From: Bob Butler
- How to reset or clear a date field
- Prev by Date: Re: Newsgroup changes?
- Next by Date: Re: Newsgroup changes?
- Previous by thread: Re: How to reset or clear a date field
- Next by thread: Re: How to reset or clear a date field
- Index(es):
Relevant Pages
|