I have a number of TextBoxes that either display a Date, remain blank, or display "NA" if a date is not required.
They are three distinct options - 1) Date required and present; 2) Date required and missing (Blank); 3) Date not required ("NA")
I've formatted the TextBox to highlight it if it is blank (requires an entry).
The issue I have is that I'm using Format(CDate(TextBox),"dd/mm/yy") to display the date and of course it is finding a error as soon as it encounters an "NA". If I don't format the code to display a date, it is displaying the numerical code instead. I've tried various "if" functions in the "Change" sub for the TextBox, but nothing seems to have the desired effect.
I'm not sure where I'm going wrong.
They are three distinct options - 1) Date required and present; 2) Date required and missing (Blank); 3) Date not required ("NA")
I've formatted the TextBox to highlight it if it is blank (requires an entry).
The issue I have is that I'm using Format(CDate(TextBox),"dd/mm/yy") to display the date and of course it is finding a error as soon as it encounters an "NA". If I don't format the code to display a date, it is displaying the numerical code instead. I've tried various "if" functions in the "Change" sub for the TextBox, but nothing seems to have the desired effect.
I'm not sure where I'm going wrong.