
Carrying Date Forward to New Record
I have a data entry form that I am trying to make as easy to use as
possible. A lot of field entries are the same among the various records so I
want these values to remain persistent as each new record is added.
I can accomplish this by setting the default value for a control bound to a
particular field each time a record is added. This appears to work fine for
all fields except the one involving the date/time datatype.
When the user enters the date for a new record, the default value is set by
the following code in the after update event of the control:
txtDate.DefaultValue = txtDate.Value
MsgBox txtDate.Value ' diagnostic
The disgnostic message box displays the correct date.
In the form's after update event, I prompt the user if they want to add
another record. If "OK" the following code executes:
If bytChoice = vbOK Then
DoCmd.GoToRecord , , acNewRec
MsgBox txtDate.Value ' diagnostic
cboSwimmer.SetFocus
End If
At this point the diagnostic messgage box displays the value: 12:22.02 AM.
Does anyone have any idea why the value for the date would change?
Thanks
Dave