Ann has attended:
Access VBA course
Access Advanced course
Dates
Is it possible to add a specified number of days to a date inserted in a field. I might for example want to initiate a prompt in the form of a message box if the calculated field (say original date + 7) is today's date.
RE: Dates
Dear Ann
Thank you for attending Access VBA course!! I hope you enjoyed the course and benefited from it.
I am not sure how comfortable you are dealing with Forms and creating calculated fields.
This answer may not be to our specific requirement so I'll just explain the general method of date calculation.
If you want a date to be calculated by adding few days to an existing field that contains a date you can simply type this command:
[field_name]+3
You can also perform the AddDate function:
The syntax for AddDate is:
DateAdd(interval, number, date)
Interval is the interval of time you want to add.
yyyy for Year
q for Quarter
m for Month
y for Day of year
d for Day
w for Weekday
ww for Week
h for Hour
n for Minute
s for Second
Note that any of these have to be entered in Inverted Commas e.g. "d"
Number is the number of intervals you want to add. E.g. if you want three days then you type 3 ensuring the first part is "d"
date is the section where you can either type any date, or you can simply type the a field in square brackets that contains a date content or if you wish to add the no. of days from today