Date Calculation

  • Thread starter Thread starter Cam
  • Start date Start date
C

Cam

Hello,

I have a table with a field called "CalDate"
and "NextCalDate" in Date format.
I would like to automatically calculate the NextCalDate a
year from the CalDate when the CalDate is entered.
How do I go about with the code? Thanks
 
Hey,

Try this: NextCalcDate=DateAdd("YYYY",1,CalDate)

Should work!

Cheers,

Avi
 
Avi,

Where on the field (of the table)I need to put this code?
My NextCalDate is also a Date/Time field. I tried putting
in the the default value row, but it says Type mismatch.
Thanks again.
 
Where on the field (of the table)I need to put this code?
My NextCalDate is also a Date/Time field. I tried putting
in the the default value row, but it says Type mismatch.

You cannot create calculated fields at the table level. You need to use a form
and, rather than storing the resulting value, use a "calculated field", which is
merely a textbox with a "control source" something like what avi provided:

=DateAdd("yyyy",1, [CalDate])
 

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