Hi y'all, I think I have a problem in my code.
I have text box that accept Date and I store the date that user have entered in a variable called txDateStart, in the code it look like this:
CODE
Dim txDateStartval as DateTime = CDate(txtAccDateStart.Text)
You see I wanna make that textbox becomes like this "" or just plain empty when the user doesn't fill anything. The Problem is when I debugged the code it still accept #12:00:00 AM# or #1/1/0001# or something like that even if the texbox was empty, how can I just make it to this "" or just empty so it doesn't pass anything to the variable that holds the textbox value. I already tried this one but it gave me nothing but just error and exceptions.
CODE
If CDate(txtAccDateStart.Text) = String.Empty Then
txDateStartval = CDate("")
Else
txDateStartval = txDateStart
End If
I believe my code above is wrong, so can you dudes tell me how to make it right, please anykinds of help I would appreciate it Thanks.
FYI:I use Visual Studio.NET 2003
Best Regards.