G
Guest
Hi gang,
I have a rather lengthy INSERT statement in VBA as part of the code for a
command button. There are date fields as well as variants and currency
fields all being entered.
Some of the fields will be null at the time the code is invoked. I've
played around with the Nz function, and seen that it can only be used with
Variant data types. So, what exactly do I do about the date data type
fields? Do I declare them as Variant in the Dim statement, use the Nz
function and try to convert back to a date? If so, how would that look
exactly?
If the variable in question is dDate, would I have to do something like this?
Dim dDate as string
"insert into table ' " & Nz(dDate,null) & " ';"
or:
"insert into table #" & Nz(dDate,null) & "#;"
As always, thanks for everything.
I have a rather lengthy INSERT statement in VBA as part of the code for a
command button. There are date fields as well as variants and currency
fields all being entered.
Some of the fields will be null at the time the code is invoked. I've
played around with the Nz function, and seen that it can only be used with
Variant data types. So, what exactly do I do about the date data type
fields? Do I declare them as Variant in the Dim statement, use the Nz
function and try to convert back to a date? If so, how would that look
exactly?
If the variable in question is dDate, would I have to do something like this?
Dim dDate as string
"insert into table ' " & Nz(dDate,null) & " ';"
or:
"insert into table #" & Nz(dDate,null) & "#;"
As always, thanks for everything.