I want a CompletedDate field updated when I check the "Completed" check box on a form.
This is the After Update Event Procedure:
The form is viewed as a datasheet and is used as a subform on another form. There is another date field that automatically fills in a date when each record is created. The problem is that the DateCompleted field/control is being updated with the same date as the first date field, instead of now's date. I have tried replacing "Date" in the above code with "Date()" and "Now" and "Now()".Code:Private Sub Completed_AfterUpdate() If Me.Completed = True Then Me.DateCompleted = Date End If End Sub
As I was typing this, it occurred to me that perhaps since the first date field (as is the control on the form) is called "Date", then perhaps that's why it is updating the "DateCompleted" field with the date from the Date field. So, I changed the name of both the control and the field. It is no longer updating with the date from the first date field--now, I get this error message:
Run-time error '2465':
Microsoft Access can't find the field 'Date' referred to in your expression.
Help, please?
ETA: For clarity, the first date field and control are called "DateCreated." The second one is called "DateCompleted."