Dateadd

Mr Bean

Pretty fly for a whiteguy
Local time
Today, 17:09
Joined
Feb 26, 2007
Messages
3
Hi

I have been trying to add a formula I found here but I cannot for the life of me get it right. I have trawled the archives for help on this but this is about as close as I can get to what I am trying to do.

Code:
=DateAdd("yyyy",1,[DateLastServiced])

I am adding this to the control source for the text box I am using.

Please can yo tell me if I am trying to put the code in the right place.:confused:

Cheers

Beanie
 
This is what you need;

On your form put an unbound text box and call it txtNextServiceDate. Then put this code in your form.

Code:
Private Sub CusServiceDate_AfterUpdate()
Me.txtNextServiceDate = DateAdd("yyyy", 1, [CusServiceDate])
End Sub

Private Sub Form_Current()
Me.txtNextServiceDate = DateAdd("yyyy", 1, [CusServiceDate])
End Sub
 
Thanks John. I was trying to use the equation in the wrong place

Doh!!
 

Users who are viewing this thread

Back
Top Bottom