J
Jim Shaw
BlankI'm having trouble finding a consistent way, or even a set of working ways, of dealing with variables of type date when I want to indicate that there is no date. I keep getting "Invalid use of Null", "invalid syntax" or "Type mismatch" messages. I've tried in both date and string types, nothing seems to work consistently across my situations. I've used, Null, #00/00/00#, 0, "" ... nothing seems to work reliably.
In Access/XT I have:
a.. a table, with a date column, upon which I define DAO.recordset
b.. a form with VBA code that manipulates dates non-arithmetically
c.. a class object that has a date type property.
In my VBA code, if I assign the date in the table to the class object date property and the date field in the table has no date, I get "Invalid use of Null"
In my VBA code, I'd like to explicitly set the date object date property to a state indicating that there is no date specified, and then be able to test for that in my class object code.
When in the debugger I look at an empty date record, the date is displayed as "Null", but I'm not allowed to set it to null in the tables datasheet view, nor can I set it to zero!!??
If I have a valid date, everything goes well. But if I have no date, everything falls apart.
What is a good day to cope with a unknown or unspecified date situation?
Thanks
-Jim
In Access/XT I have:
a.. a table, with a date column, upon which I define DAO.recordset
b.. a form with VBA code that manipulates dates non-arithmetically
c.. a class object that has a date type property.
In my VBA code, if I assign the date in the table to the class object date property and the date field in the table has no date, I get "Invalid use of Null"
In my VBA code, I'd like to explicitly set the date object date property to a state indicating that there is no date specified, and then be able to test for that in my class object code.
When in the debugger I look at an empty date record, the date is displayed as "Null", but I'm not allowed to set it to null in the tables datasheet view, nor can I set it to zero!!??
If I have a valid date, everything goes well. But if I have no date, everything falls apart.
What is a good day to cope with a unknown or unspecified date situation?
Thanks
-Jim