Hi guys
I have a simple form with 8 controls where the user can input into data into a minumum of one up to all eight. Therefore, not every control is required to be filled in.
I set a bunch of variables based on the values in the controls for later use in some SQL code. The rest all work perfectly, apart from my Date of Birth component. This is a basic textbox but with the Short Date format and an input mask. I plan on adding data validation at some point as well, but I just want to get up and running with some VBA SQL code first.
The code is used to test if the textbox is neither null nor an empty string, and if it isn't then it pulls out the date entered into a Date type variable. It works fine when a date is entered. However, it bugs out due to "type mismatch" when the textbox is empty, hovering my cursor over the value indicates Me.TxtPatDoB = "" (I think).
Code:
'patient DoB should be entered full (will use data validation to ensure) If Not IsNull(Me.TxtPatDoB) Or Me.TxtPatDoB <> "" Then
dateOfBirth = Me.TxtPatDoB.Value
End If
Is there a workaround or better solution?
Thank you