Auto generation dates in Access (1 Viewer)

Charlie100

New member
Local time
Today, 20:14
Joined
Nov 2, 2021
Messages
12
Hi

Within a form in MS access is it possible to auto generate the date based on two criteria.

I have a date say 01/01/2021 displayed in field 1
Field 2 dislays the review frequency say 6 months, 1 year, 18 months and 2 years

How would I autogenerate the field 3 value with the correct future date?

Any help would be greatly appreciated.

Charlie
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:14
Joined
Sep 21, 2011
Messages
14,047
Look at the DateAdd() function.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:14
Joined
Oct 29, 2018
Messages
21,358
Hi Charlie. Welcome to AWF!

As Gasman said, you should be able to use DateAdd(), but you'll have to be specific about the frequency unit. It can be days or months or years; but if you have a mixed frequency, you'll have to convert them into a single frequency first. For example, 1 year and 6 months will have to use 18 months instead.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:14
Joined
May 7, 2009
Messages
19,169
you bring your table in design view and add Data Macro (Before Change):
before_change.png
 

Charlie100

New member
Local time
Today, 20:14
Joined
Nov 2, 2021
Messages
12
Firstly, what a brilliant community. Really pleased to have found this place.

Really appreciate the replies received - most useful. Thank you

Charlie
 

Users who are viewing this thread

Top Bottom