bConverted = ParseDate(tfSaleDate.Text, dSaleDate)
if not bConverted then
dSaleDate = nil
end if
rsRecall.Field("SaleDate").DateValue = dSaleDate
I have an SQLite database with a Field called “SaleDate” as a Date field. In an Edit Window the user can either enter a sale date or leave it blank. But I get an exception when the SaleDate is nil when I test it for “<> nil”. How do I represent “no or empty date” in a date column?
bConverted = ParseDate(tfSaleDate.Text, dSaleDate)
if not bConverted then
dSaleDate = nil
end if
if dSaleDate is nil then
rsRecall.Field("SaleDate").Value = nil
else
rsRecall.Field("SaleDate").DateValue = dSaleDate
end if
I just ran into the same question!
I read this thread, but I never made it to work… I tried different alternatives, such as .NotNil and some other… with no luck!
Excuse me for hijacking someone-else’s thread… But really, I would name the thread the same myself!
I’ve included little more code in the image.
I’ve tried some (failing) alternatives… but really, my eyes don’t see the missing part!
I look at your Redim and the first subscript within it is “1”. Now down in your code you have the first subscript of 2 in one one and 3 in the next. That is out of bounds because the Redim only allows for 0 or 1 as the first subscript.