increase date() by 1 year

ninja_imp

Registered User.
Local time
Today, 10:42
Joined
Apr 11, 2006
Messages
50
hi

is there any way that i can increase the value held in date() by 1 year or 2 or so on?

regards
 
excellent i'll give it a go.

thnx
 
Code works great - thanks - used it a bit different and made it so the number is controlled by a combo box so a year can be chosen - but can i do it so that also the month can be be changed?

Regards
 
im using that at the minute - or trying to - with the below:

currentDate = Date

DDay = Day(Now())
Dmonth = DateAdd("m", MonthNow, currentDate)
DYear = DateAdd("yyyy", YearNow, currentDate)

dtoday = DateSerial((DYear), (Dmonth), (DDay))

with MonthNow and YearNow both getting their values form combo boxse. It was working fine with just the year one but now im using date add for the month i keep getting an over flow error - both MonthNow and YearNow are set as Integers. Cant get it???

rgds
 
Dmonth = Month(DateAdd("m", MonthNow, currentDate))
DYear = Year(DateAdd("yyyy", YearNow, currentDate))
 
hi

managed to get a result:

DDay = Day(Now())


Dim NewDate As Date
NewDate = DateAdd("yyyy", Me.cmbYear, Date)
NewDate = DateAdd("m", Me.cmbMonth, NewDate)


dtoday = NewDate
todaydate = dtoday - DDay 'get first day of the month
DDate = todaydate

many thank s for your help
 

Users who are viewing this thread

Back
Top Bottom