Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems opening second recordset with SQL

Status
Not open for further replies.

sda7bobp

Technical User
Feb 14, 2005
28
0
0
US
I am trying use datea from 2 recordsets to make calculations and append that information into a 3rd recordset. When I try to open the second recordset using the OpenRecordset method with an SQL statement, I get and "Error 3061: Too few parameters: Expected 1". Here is the code:

Dim db as Database, rst As Recordset
Dim rst1 as Recordset, strSQL as String
Dim lngID As Long

Set db = CurrentDb
Set rst = db.OpenRecordset ("tblInvUsed")

lngID = 1

Set rst1 - db.OpenRecordset (strSQL)
It is here that I get the error message.
What am I doing wrong?

Bob
 
Bob:

If you are using that exact code you should look at the second "Set" statement. It should read:

Set rst1 = db.OpenRecordset(strSQL)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top