dates

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Dates

Dates

resolvedResolved · Medium Priority · Version 2003

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

RE: Dates

Thank you for your response. This answers my question.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Design View in Relationship window

Your in the Relationship window and changes are required to be made to a Table's design.

Rather than exiting the Relationship window, if you perform a right-mouse click on the table, it opens that table up in Design view

View all Access hints and tips


Server loaded in 0.07 secs.