Can't update a date field using VBA (continuous form)

  • Thread starter Thread starter Julia Boswell
  • Start date Start date
J

Julia Boswell

All, I've got a problem with some VBA failing. I've got an after update
event on a field on a continuous form that updates other fields based on
data entered. Two of the updated fields are date fields. One works fine, the
other one doesn't and I can't understand why. Here's the code:

Me.BoardMarried.Value = Date
Me.RecordCreated.Value = Date

The BoardMarried one is fine, the RecordCreated one just makes the form hang
and the field is not updated.

RecordCreated is the control name which is bound to a field of the same
name. I've tried removing the .Value and changing the control name, neither
of which work. Has anyone got any ideas on why this should be a problem?

Thanks in advance.

Julia
 
Are you getting an error message (you may have to turn off error trapping)?
Also, did you try breaking the code when it hangs to see where the code is
getting stuck?
You could try swapping the order of the two statements to see what happens
then.

- Dorian
 
Thanks, that helped. I turned off error trapping and found out that the
problem was that the next bit of code was setting focus to another control,
which is where it was stalling.

Julia
 
Back
Top