G
Guest
I am trying to open a recordset that is based on a parameterised query. Here
is the code:
Private Sub cmdRecCnt_Click()
Dim rec As DAO.Recordset
Set rec = CurrentDb().OpenRecordset("qryGetInfo")
rec.MoveLast
txtRecCnt.Value = rec.RecordCount
rec.Close
End Sub
There are 4 text boxes on a form that supply the filter criteria for 4
fields in the query "qryGetInfo".
When I click the button to run the subroutine, I get an error that says:
"Run-time error 3061
Too few parameters. Expected 4"
All 4 text boxes are populated with valid data. I also have a list box on
the same form that displays the results of the same query with no problem. I
would like "txtRecCnt" to display the number of records displayed in the list
box.
Thanks in advance for the help.
is the code:
Private Sub cmdRecCnt_Click()
Dim rec As DAO.Recordset
Set rec = CurrentDb().OpenRecordset("qryGetInfo")
rec.MoveLast
txtRecCnt.Value = rec.RecordCount
rec.Close
End Sub
There are 4 text boxes on a form that supply the filter criteria for 4
fields in the query "qryGetInfo".
When I click the button to run the subroutine, I get an error that says:
"Run-time error 3061
Too few parameters. Expected 4"
All 4 text boxes are populated with valid data. I also have a list box on
the same form that displays the results of the same query with no problem. I
would like "txtRecCnt" to display the number of records displayed in the list
box.
Thanks in advance for the help.