Hi everyone,
I've got an ADO AddNew update query in VBA. Some of the fields may be
empty and I want to know if there is an easier way than writing If
statements around each field to test for null.
Here's my code
.AddNew ' create a new record
' add values to each field in the record
.Fields("fkRSCWeekID") = Range("AA" & r).Value
.Fields("fkPrimeID") = Range("R" & r).Value
.Fields("fkTypeID") = Range("S" & r).Value
For example, right now if the first field (fkRSCWeekID) is blank it
throws a Type Mismatch error. Can anyone please advise how I can run
the update regardless of whether the field is populated or not?
Thanks in advance,
Jeff