I am using a VB2010 form as a front end to an Access database. I am having two problems when reading/writing date fields.
1) When reading a date from the dataset, it doesn't display properly on the form if the date has a single digit for the month and/or day. Example: 9/23/2011 displays as 92/32/011
I'm using the following to read into a masked text box with the mask set to short date:
mtxtRequestDate.Text = ds.Tables("WorkOrders").Rows(inc).Item("RequestDate").ToString
2)When saving a date field, if the field is blank I get the following error:
String was not recognized as a valid DateTime.Couldn't store < / /> in RequestDate Column. Expected type is DateTime.
I'm using the following to write to the dataset:
ds.Tables("WorkOrders").Rows(inc).Item("RequestDate") = mtxtRequestDate.Text
Thanks in advance.