Hello Everyone,
I have a masked textbox for date mm/dd/yyyy - mskdate.text
I need to do the following:
If this masked textbox is empty, then the user will be prompted to enter a date when clicking on the SAVE button. However, it doesn't do anything. I tried to use Is Nothing instead of = Nothing or = "" too, it did not worked. When I debugged the code, it bypassed all the lines between Then and End If. Would you please take a look at the code below and advise me another way to achieve this or tell me what I did wrong?
Thanks much!
If mskDate.Text = "" Then
MsgBox("You must enter a date.")
mskDate.Select()
Return False
End If
I have a masked textbox for date mm/dd/yyyy - mskdate.text
I need to do the following:
If this masked textbox is empty, then the user will be prompted to enter a date when clicking on the SAVE button. However, it doesn't do anything. I tried to use Is Nothing instead of = Nothing or = "" too, it did not worked. When I debugged the code, it bypassed all the lines between Then and End If. Would you please take a look at the code below and advise me another way to achieve this or tell me what I did wrong?
Thanks much!
If mskDate.Text = "" Then
MsgBox("You must enter a date.")
mskDate.Select()
Return False
End If