How can this
if (NOT RecordSet.EOF) then
be causing a
Application uses a value of the wrong type for the current operation