Recordset problem

rbinder

rbinder
Local time
Tomorrow, 09:31
Joined
Aug 13, 2005
Messages
25
Greetings all,

I am getting an error message on this code of Runtime error '3061' Too few paramters expected '1'

The code is;

Dim db As DAO.Database, qr1 As DAO.QueryDef
Dim rs1 As DAO.Recordset, rs2 As DAO.Recordset
Dim strSQL As String
Set db = DBEngine(0)(0)
varRet = [Forms]![frm_Data_WineAllocations_Edit]![AllocationID]


strSQL = "SELECT tbl_Data_AllocationLineitems.AllocationID, tbl_Data_AllocationLineitems.WineNumber,"
strSQL = strSQL & "tbl_Data_AllocationLineitems.Amount "
strSQL = strSQL & "FROM tbl_Data_AllocationLineitems "
strSQL = strSQL & "WHERE (((tbl_Data_AllocationLineitems.AllocationID)= VarRet));"

'get count of products on the allocation table
Set rs2 = db.OpenRecordset(strSQL)

Can anyone guide me to changing the code to be able to get the data from the recordset.

Thanks in advance

rbinder
 
Hey rbinder,

Try:

strSQL = "SELECT tbl_Data_AllocationLineitems.AllocationID, tbl_Data_AllocationLineitems.WineNumber,"
strSQL = strSQL & "tbl_Data_AllocationLineitems.Amount "
strSQL = strSQL & "FROM tbl_Data_AllocationLineitems "
strSQL = strSQL & "WHERE tbl_Data_AllocationLineitems.AllocationID =" & varRet

HTH,
Shane
 

Users who are viewing this thread

Back
Top Bottom