Hi, I am using Trevor Eyre's CalendarForm to enable date entries into my Excel Form, this works perfectly if the day is >12 as it is very clear which is the month/day and so correctly formats the output into UK dd/mm/yy, (which I subsequently convert to yy/mm/dd to avoid all future confusion), however if the day is less than 12 then it incorrectly shows the date, effectively swapping month/day over, so an entry of 6th Feb appears as the 2nd june instead.
I have added CDATE to the copy of the form data into a cell and this works perfectly and has resolved the above problem, HOWEVER if I press the populate data to spreadsheet before I have filled in this form entry it errors (IE cdate is trying to compute a blank entry). If I remove the cdate from the code below then it does not error when I run.
This is the code line which fails if I press go on the macro and I have not filled in the form "T_Need_Date" text box
This code with cdate removed works all the time, but sometimes creates a "back to front" date, US instead of UK
if i remove the cdate from the above code it works without error.
How can I adjust the code above to stop it erroring if I accidently start the macro without populating the "T_need_Date" text box (ie it is still blank)
Thank you, I hope this is clear to understand.
I have added CDATE to the copy of the form data into a cell and this works perfectly and has resolved the above problem, HOWEVER if I press the populate data to spreadsheet before I have filled in this form entry it errors (IE cdate is trying to compute a blank entry). If I remove the cdate from the code below then it does not error when I run.
This is the code line which fails if I press go on the macro and I have not filled in the form "T_Need_Date" text box
VBA Code:
Sheet5.Cells(35, 11).value = CDate(FRM_Concession_Application.T_Need_Date)
This code with cdate removed works all the time, but sometimes creates a "back to front" date, US instead of UK
VBA Code:
Sheet5.Cells(35, 11).value = (FRM_Concession_Application.T_Need_Date)
if i remove the cdate from the above code it works without error.
How can I adjust the code above to stop it erroring if I accidently start the macro without populating the "T_need_Date" text box (ie it is still blank)
Thank you, I hope this is clear to understand.