2

I have written a Shared Add In using VS 2008 which contains a public method that returns an ADO Recordset. In MS Access I would like to set a ADO Recordset to the return of the function call. The function call executes fine when calling the COM object. However assigning a ADO Recordset in VBA to the function returns a "Compile error: Invalid use of Property" . What am I doing wrong?

Dim result As ADODB.Recordset

result = .Object.doSomething(parameter1, parameter2)

1 Answer 1

1

Use the Set keyword when assigning to an object variable.

Dim result As ADODB.Recordset

Set result = .Object.doSomething(parameter1, parameter2)
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Hansup, I rarely ever work in vba and have little experience in the syntax. Your suggestion worked!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.