OK, something I thought would be straight forward is giving me the run-around.
Dates.
So, one part of my application stores the current date+time in a textbox like this:
DIM d as New Date
TextBox1.Text = d.SQLDateTime
And another part of my application needs to read in that information (at a later stage) and compare it with another date+time stored in the same way, in a different text box:
DIM CurrentDate as Date
DIM converted as Boolean
converted = ParseDate(TextBox1.Text, CurrentDate)
Label1.Text = Str(CurrentDate)
The moment I run this bit of code, the debugger kicks in and tells me that CurrentDate is “nil” and that converted is “False”.
I could be doing something really stupid here, but I kinda thought that if I stored a SQLDateTime in a textbox that I would be able to retrieve this information from the text box and convert it back into a date with relative ease. I would prefer to use dates (and SQLDates so there’s always a consistent formatting) instead of messing around manually parsing the text to figure out which bit is the year, month, day, hour, minute & second.
What am I doing wrong?