I have a line in App.Open event of
Dim d As New Date
d.SQLDateTime = "2017-09-07"
If I have a line of code later in a module with an identical (almost) string I get either a NilObjectException or a UnsupportedFormatException.
Thoughts on how this happens?
[quote=355648:@Arthur Gabhart]I have a line in App.Open event of
Dim d As New Date
d.SQLDateTime = "2017-09-07"
If I have a line of code later in a module with an identical (almost) string I get either a NilObjectException or a UnsupportedFormatException.
Thoughts on how this happens?[/quote]
The code here is valid. It assumes 00:00:00 for the time.
How about showing us the code thats failing?
Edit: Sorry. I hadn’t initialized the date with “New”
Sure. It is read in from a file as UTF8
tstDte is Date
The value for the string aTemp(11) is “2017-08-01”
tstDte.SQLDateTime = aTemp(11)
[quote=355651:@Arthur Gabhart]Edit: Sorry. I hadn’t initialized the date with “New”
Sure. It is read in from a file as UTF8
tstDte is Date
The value for the string aTemp(11) is “2017-08-01”
tstDte.SQLDateTime = aTemp(11)
[/quote]
so now that you are initializing the date, is it working properly?