VB6 "Invalid use of property" error where the code seems fine

vb6

Solution

You need to use

set rsTemp = rsDocs

since rsTemp is an object.

Problem

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!

Original source