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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding years to a date 1

Status
Not open for further replies.

taylornow

Technical User
Oct 16, 2000
90
US
Hello everybody-
My quandry is this- I need a field to update automatically when a date is entered. You guys already helped out on a big one for me so here is another.

one field called - EFFECTIVE DATE
one field called - REINSPECTED

What needs to happen----
the REINSPECTED needs to auto calculate 5 years from the EFFECTIVE DATE.

Do I use DATEADD? I tried but syntax error comes back to haunt me.

Thanks in advance
Taylor
 
Try DateAdd("yyyy", 5, [Effective Date]). In my test I assigned it to a variant varDate: varDate = DateAdd("yyyy", 5, [Effective_Date]) and it worked fine. Note, my field Effective_Date has an underscore in it but that just my personal naming preference.
 
FoxPro- ""can't determine what action- misspelled- punctuation incorrect-procedure isn't defined"". It is spelled correctly. The others - I am clueless - just learning code.

evalesthy- that is the exact code I typed in. When you say where you assigned it - varDate- you lost me.

Okay - sounds crazy but ... do I make it an After Update on the EFFECTIVE DATE ? Just want to make sure I have it in the right place.

Thanks again in advance
Taylor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top