access 2010 vba calculate dates

Hi,

I have a query regarding using vba to calculate due dates.

Overview:
i have a form where the user enters an start date for a contract. What i need to do is, after the start date has been entered, auto calculate 2 different dates based upon the month of the start date.

i.e. if the start date entered is any day in January, for example 05/01/2014, then due date to be calculated should be 01/03/2014, settlement date to be calculated should be 31/03/2014.

Start Date                Due Date             Settlement Date
any day in Jan           01/03/2014          31/03/2014
any day in Feb          01/04/2014          30/04/2014
etc etc

Many thanks
andrewpiconnectAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Dale FyeConnect With a Mentor Commented:
DueDate = DateSerial(Year([StartDate]), Month([StartDate]) + 2, 1)

SettlementDate = DateSerial(Year([StartDate]), Month([StartDate]) + 4, 0)
0
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
SettlementDate exceeds by a month

should be
SettlementDate = DateSerial(Year([StartDate]), Month([StartDate]) + 3, 0)
0
 
andrewpiconnectAuthor Commented:
Thanks Guys....works a treat
0
 
Dale FyeCommented:
Thanks for catching that Rey, I hate dd/mm/yy format!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.