Hello. Back in the day I used to use the datepicker to enter dates but Microsoft realised that I'm now getting on in age it would be nice of them to retire the datepicker to help me towards retirement also. Now I no longer have the datepicker I have to use the dateadd function to add a day to a date but, unfortunately, this is seemingly impossible. Today the date is the 12th of September 2022 and I have spent all morning trying to add a button to a userform to add one day to the date in a hidden textbox and another button to subtract a day from the date in the hidden textbox. If I add it seems to be fine I'll get 13th of september but if I subtract I get some date in October. I tried my best to sort the issue out for myself but there are thousands of posts on google about people having similar issues with no solutions jumping out at me.
To simplify what I'm trying to achieve I'll explain a simplified version of the userform I have. Let's say there's four items. A visible datebox which shows the contents of a hidden textbox and 2 buttons. One button is to add one day to the date, the other is to subtract one day from the date. The date I'm working with is contained in the hidden textbox and the visible textbox shows a formatted version of the working date. Ie the hidden textbox will contain 12/9/2022 whereas the visible one will show "Mon 12-09-2022". I would like to be able to click on the command button labelled "+" to add a day and the command button labelled "-" to subtract a day. Have you any ideas how I can achieve this without the months and days swapping over as seems the default for Microsoft if the day is less than the 12th of the month?
To simplify what I'm trying to achieve I'll explain a simplified version of the userform I have. Let's say there's four items. A visible datebox which shows the contents of a hidden textbox and 2 buttons. One button is to add one day to the date, the other is to subtract one day from the date. The date I'm working with is contained in the hidden textbox and the visible textbox shows a formatted version of the working date. Ie the hidden textbox will contain 12/9/2022 whereas the visible one will show "Mon 12-09-2022". I would like to be able to click on the command button labelled "+" to add a day and the command button labelled "-" to subtract a day. Have you any ideas how I can achieve this without the months and days swapping over as seems the default for Microsoft if the day is less than the 12th of the month?