recordset objects and joining them in VBA

G

Guest

Hi,
I have successfully created 2 recordsets in VBA and now I want to join them
in the code to create a 3rd, new recordset. I have created an SQL statement
that would work if there was actually a query object created, but since
everything is "virtual" in the VBA code, how do I do this?
 
G

Guest

I think I may have fixed the problem...or at least gotten a step closer.

Instead of using recordsets, I've created new querydefs so that I can call
the queries with an object variable.
 
M

Marshall Barton

Steve said:
I have successfully created 2 recordsets in VBA and now I want to join them
in the code to create a 3rd, new recordset. I have created an SQL statement
that would work if there was actually a query object created, but since
everything is "virtual" in the VBA code, how do I do this?


The joining needs to be done in a query before you start
messing with recordsets. If you just want one set of
records to follow the set of Records, then UNION your two
queries.
 
P

pietlinden

I think I may have fixed the problem...or at least gotten a step closer.

Instead of using recordsets, I've created new querydefs so that I can call
the queries with an object variable.

you can create a recordset based on a query string or canned query.
You could use a union query...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top