Too Few Parameters error message

JKB

Registered User.
Local time
Today, 23:42
Joined
Feb 25, 2001
Messages
10
After pressing Command Button CmdResearch, after making selections from 7 combo boxes, I receive a error message: Too Few Parameters; Expected 7


Private Sub CmdResearch_Click()
On Error GoTo Err_CmdResearch_Click

'This command button is on frmPriceResearch. After a user makes selections_
'from 7 combo boxes that serve as parameters in the query, QPriceLookup,_
'the user then presses this command button.
'At this point, I am only trying to verify the number of records that made it into the_
'recordset. Later, I'll write code to "do something" if some records were found, or _
'"do something else" if no records are found.

Dim db As Database
Dim rec As Recordset
Dim intRecords As Integer
Dim stQDF As String

stQDF = "QPriceLookUp"

Set db = CurrentDb()
Set rec = db.OpenRecordset(stQDF)

' at this point in the code an error message displays that indicates: Too few 'parameters; expected 7

intRecords = rec.RecordCount

MsgBox "There are " & intRecords & " records in the Recordset QPriceLookUp"


rec.Close
Set db = Nothing

Exit_CmdResearch_Click:
Exit Sub

Err_CmdResearch_Click:
MsgBox Err.Description
Resume Exit_CmdResearch_Click

End Sub
 
Jack I looked at the knowledge base and this did help, but I have 2 parameters so at the point where I set my rs I don't know how to set the two parameters any suggestions?

Thanks
kim
 

Users who are viewing this thread

Back
Top Bottom