Date Field Update Based on 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
 
R

ruralguy via AccessMonster.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top