Re: Error 13 in debug.print
Add this:
Code:
Debug.Print adoRecordset.Fields("UID").value
Debug.Print adoRecordset.Fields("UID").value
somewhere and you'll see the problem.
Check the values BEFORE setting the variable
Re: Error 13 in debug.print
Yes, the problem is the iif() function, I guess.
In an iif always both resulting terms are evaluated. This leads to problems in some case.
Try to formulate this as an If Then Else statement.
Using If Then Else does NOT execute the statements of the opposite condition.
Code:
If isnull(adoRecordset.Fields("UID").value) Then strUID = "" Else strUID=adoRecordset.Fields("UID").value
But come to think of it... because of Type Mismatch Error...
If .Fields("UID").Value is a numeric data type you simply have to convert it to string within the Iif statement:
Code:
strUID=iff(isnull(adoRecordset.Fields("UID").value),"",CStr(adoRecordset.Fields("UID").value))