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
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