adding dates

mee100

New member
Local time
Today, 06:41
Joined
Apr 4, 2007
Messages
3
Hi all,
i have a form in ACCESS, that contains three fields:

-date1
-duration
-date2

both date1 and duration will entered form the user, and they will added together to give me date2.

here is the code of the whole form:

Private Sub Command8_Click()
On Error GoTo Err_Command8_Click

DoCmd.GoToRecord , , acNewRec

Exit_Command8_Click:
Exit Sub

Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click

End Sub

Private Sub date1_BeforeUpdate(Cancel As Integer)
End Sub

Private Sub date2_BeforeUpdate(Cancel As Integer)
End Sub

Private Sub dur_BeforeUpdate(Cancel As Integer)
End Sub
------------------------------------------------
and here is a function that i think that it might help in this manner:

Privete Sub date2_BeforeUpdate = DateAdd("m",dur_BeforeUpdate, date1_BeforeUpdate)

but am not getting it right.
thank you
 
Why not just put =DateAdd("m",duration,Date1) in the source of Date2.

Brian
 

Users who are viewing this thread

Back
Top Bottom