Setting up a specific date

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

Guest

I have a "Date Sent" field and "Date Due" field. I want to have the "Date
Due" field automatically set 15 days from the "Date Due" field. So if I
enter 09/18/06 in the Date Sent field the Date Due will automatically state
10/02/06. Any Ideas???
 
Ignore the reply from David Pawloski - it is spam

If the DateDue field is always 15 days from the date sent field, don't store
it. Just calculate it when needed using

DateAdd("d",15, DateSent)

If, on the other hand, the DateDue field is normally 15 days, but in some
case it will differ then in the form, you can use vba to populate the
DateDue control when DateSent is entered. Using the AfterUpdate event of
DateSent the UNTESTED AIRCODE might be.

Private Sub DateSent_AfterUpdate()

If IsDate(DateSent) then
Me.DateDue = DateAdd("d",15,Me.DateSent)
End if

End Sub
 

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

Back
Top