After Update Field Populate Another Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, does this need programming? I want a field to be populated after updating
it with a Date. For example, FieldInitialDate and FieldEndDate. This 2 dates
should be the same, but sometimes will be different. Also, have a check on
the FieldEndDate to make sure that date is not before the FieldInitialDate.

Thanks
 
Hi, does this need programming? I want a field to be populated after updating
it with a Date. For example, FieldInitialDate and FieldEndDate. This 2 dates
should be the same, but sometimes will be different.

Use the AfterUpdate event of FieldInitialDate to "push" the entered value into
FieldEndDate:

Private Sub FieldInitialDate_AfterUpdate()
If IsNull(Me!FieldEndDate) Then ' don't stomp on existing data
Me!FieldEndDate = Me!FieldInitialDate
End If
End Sub
Also, have a check on
the FieldEndDate to make sure that date is not before the FieldInitialDate.

Check in the Form's BeforeUpdate event, and cancel that event if it's not.

John W. Vinson [MVP]
 
Back
Top