Error when replacing a date field with a new date value
Posted on 2006-07-04
I am trying to make changes to existing date entries in an Access table. The new value is taken from a textbox in a form. The new value is entered in the textbox in the date format used in creating the table.
When I execute the code it causes runtime error 3105 "Update or CancelUpdate without Addnew or Edit."
Code involved is:
Set rst = CurrentDb.OpenRecordset(strSQL)
If dateAcquired <> rst(4) Then
rst(4) = Application.Forms!SoftwareEditRecord.Controls!dateAcquired
In the VBA Sub of which the code above is a part there are several successful updates to text and integer fields before the error occurs.
The values shown for the Recordset field rst(4) and the form control dateAcquired are correct when printed to the immediate window.
Is there a way to replace the value in a date field?
Thanks for your help.