Good day all,
I hope everyone enjoyed the Christmas break as much as I did and
you have my sympathy if you reply to this question today since it may mean that like me you are back to the office already !
Anyway, I do have a problem regardign the DateSerial function. I have a control on a form named txtLMonth which uses Dateserial to show the last day of the previous month like so....
Me.txtLMonth = DateSerial(Year(Date), Month(Date), 0)
Which works perfectly however i've left the field open so that the user can go back or forwards a month.
The code below works great for goign forwards a month,
Me.txtLMonth = DateSerial(Year(txtLMonth), Month(txtLMonth) + 2, 0)
it displays the last date of that month, however the back button seems to go back not one but two months. The code for which is below,
Me.txtLMonth = DateSerial(Year(txtLMonth), Month(txtLMonth) - 1, 0)
I cannot for the life of me figure out why it is doing that but if anyone can advise me on correcting this i'd be very gratefull.
Mitch....
I hope everyone enjoyed the Christmas break as much as I did and
you have my sympathy if you reply to this question today since it may mean that like me you are back to the office already !
Anyway, I do have a problem regardign the DateSerial function. I have a control on a form named txtLMonth which uses Dateserial to show the last day of the previous month like so....
Me.txtLMonth = DateSerial(Year(Date), Month(Date), 0)
Which works perfectly however i've left the field open so that the user can go back or forwards a month.
The code below works great for goign forwards a month,
Me.txtLMonth = DateSerial(Year(txtLMonth), Month(txtLMonth) + 2, 0)
it displays the last date of that month, however the back button seems to go back not one but two months. The code for which is below,
Me.txtLMonth = DateSerial(Year(txtLMonth), Month(txtLMonth) - 1, 0)
I cannot for the life of me figure out why it is doing that but if anyone can advise me on correcting this i'd be very gratefull.
Mitch....