I have a subroutine which copies data from a recordset into a range. I wrote this to avoid using CopyFroMRecordset as that function doesn't allow you to change the columns in the target area. This function takes the name of the column from the heading and gets the value by a rds.fields(<Name>).
Has been working quite well all this while (few months) and now I've run into a strange error. For some fields alone, it gives a NULL value when referred to by name like this:
rngCopy.Cells(intRow, intIx) = rds.Fields(varCols(1, intIx)) ' = Null
On the Immediate window
?rds.fields("fkIssuer")
Null
?rds.Fields(0).name
fkIssuer
?rds.fields(0)
20
It gives a null value when referred to by name and the real value when referred to by ordinal! Anyone else have this problem??
Am stumped!
Thanks guys!!
Start Free Trial