tags:

views:

42

answers:

1

I am having a very strange problem. First, the code.

Private Function ProcessRecord(ByVal rsDocs As ADODB.Recordset) As Variant

   Dim rsTemp As ADODB.Recordset
   rsTemp = rsDocs
   rsDocs = RemoveDuplicateDocs(rsTemp)

Exit Function

The error is occurring on the second line of the function, where rsTemp is set equal to rsDocs. It's saying: "Compile error: Invalid use of property". I've looked for information on this error elsewhere, and all the reports are cases where people either forgot an equal sign, or incorrectly added the "Set" command to the beginning of the line of code. This error makes no sense to me, because it was compiling fine before, and the changes I've made to this project are not even in the class that throwing the error. The code here is identical to the way it was before. Has anyone ever seen an error like this pop up for what seems to be no good reason? Thanks!

+3  A: 

You need to use

set rsTemp = rsDocs

since rsTemp is an object.

Michael Todd
Okay, that seems to be fixing the issue, but any idea why this code would have been compiling okay before? I'm extremely confused, because I made changes to this code just a few weeks ago, and it compiled fine without using "Set", and I didn't alter that part of the code then either.
Joe Majsterski
Honestly, no. That should not have compiled as is (though it's possible that there's a compiler "switch" that I'm not aware of that would allow that to get through).
Michael Todd
Thanks for your help. I realize now that the code HAD been changed between builds.
Joe Majsterski