Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate Dates by terms field

Status
Not open for further replies.

Marclem

Technical User
Aug 5, 2003
96
US
Hello everyone!

I have the following fields:

Name Date Terms Pay Date
Marc 05/25/05 30
Nancy 05/21/05 60
Peter 05/23/05 20
Mary 04/21/05 90
Paul 03/01/05 120
Vinny 02/10/05 15

What I am trying to get is a calculation from the terms field and the Date field, to have the output placed in the Pay Date field.

For example: if the date is 05/25/05 and the Terms is 30 days, then the date for the output will be 06/24/05

Thank you!
 
Hi!

If your Date is actually a date/time field then the Pay Date field will be Date + Term.

BTW, since Date is a function in access you should probably change the name of the field.

hth


Jeff Bridgham
bridgham@purdue.edu
 
How are ya Marclem . . . . .

In the [blue]code module[/blue] of the form, copy/paste the following routine:
Code:
[blue]Public Sub SetPayDate()
   If IsDate(Me!Date) And IsNumeric(Me!Terms) Then
      Me![Pay Date]=Me!Date + Me!Terms
   End If
End Sub[/blue]
In the [blue]AfterUpdate[/blue] event of [purple]Date[/purple] & [purple]Terms[/purple], copy/paste the following:
Code:
[blue]   Call SetPayDate[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thank you TheAceman1

It works like a charm!

You have been around for a while now and you have helped a lot of people in this forum.

Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top