I have a combobox that checks for saved dates and allows someone to choose from the drop-down if they want to go back and change values in the fields from that date. I have a date field with a date picker to choose a date that has yet to be saved.
My issue is that if a person uses the date picker and chooses an existing date (instead of the combobox), I get an error for the combobox code once they try to save.
I was thinking that a simple VBA code in the Lost Focus event of the date picker could fix this. It would say something to the effect of:
If Date Chosen = Existing Date ThenMsgBox("Use combobox for existing dates")
datepickerField.SetFocus
datepickerField.Clear
End If
Essentially, the user would be unable to choose an existing date from the date picker, and would have to use the combobox instead.
I don't know how to write out the first part "Date Chosen = Existing Date". All I could think of was "DTPicker0.Value =" or "Me.DTPicker0.Value = ", but wasn't sure how to check it against existing dates.
Thanks!