Date Field Update Based on Start Date

  • Thread starter Thread starter gumby
  • Start date Start date
G

gumby

I would like to update A field with a End Date that is 45 days from
the Start Date.

I have tried is in the defualt value of my enddatefield

DateAdd("d", 45, DatesOfCOPStart)

However nothing happens.

I even tried a put this on a onclick event and a got/lost foucs
event.

Private Sub Command108_Click()
Dim UpdateDate As String

If IsNull([DatesOfCOPStart]) Then
Exit Sub
Else
UpdateDate = DateAdd("d", 45, DatesOfCOPStart)
Me.DatesOfCOPEnd = UpdateDate
End If
End Sub


It updates but only after I leave the record and come back. How can I
get the field to update on the spot?


David
 
You should really *not* have a field in your table that is calculated from
another field in your table. Just calculate the value any time you need it.
I would like to update A field with a End Date that is 45 days from
the Start Date.

I have tried is in the defualt value of my enddatefield

DateAdd("d", 45, DatesOfCOPStart)

However nothing happens.

I even tried a put this on a onclick event and a got/lost foucs
event.

Private Sub Command108_Click()
Dim UpdateDate As String

If IsNull([DatesOfCOPStart]) Then
Exit Sub
Else
UpdateDate = DateAdd("d", 45, DatesOfCOPStart)
Me.DatesOfCOPEnd = UpdateDate
End If
End Sub

It updates but only after I leave the record and come back. How can I
get the field to update on the spot?

David
 
Back
Top