Hi Guys/Gals,
I got this code from somewhere on this forum awhile back but have run into a problem with it.
I have a combo that has "Current Month", "Current Quarter", etc. as well as one that says "Current Year". It should display 1/1/08 to 12/31/08. However it is showing 7/31/08 for the end date....
Can someone take a look at this and explain why the EndDate is always 1 month after the current month?
Case "Current Year"
Me.txtStartDate = DateSerial(Year(todaydate), Int((Month(todaydate) - 1) / 12) * 3 + 1, 1)
Me.txtEndDate = DateSerial(Year(todaydate), Int((Month(todaydate)) + 1) + 1, 0)
I got this code from somewhere on this forum awhile back but have run into a problem with it.
I have a combo that has "Current Month", "Current Quarter", etc. as well as one that says "Current Year". It should display 1/1/08 to 12/31/08. However it is showing 7/31/08 for the end date....
Can someone take a look at this and explain why the EndDate is always 1 month after the current month?
Case "Current Year"
Me.txtStartDate = DateSerial(Year(todaydate), Int((Month(todaydate) - 1) / 12) * 3 + 1, 1)
Me.txtEndDate = DateSerial(Year(todaydate), Int((Month(todaydate)) + 1) + 1, 0)