Sorry, I have looked for hours on this forum and cannot figure out what is going on.
Why do I get an error of "Too few Parameters, expecting 2"
My query "qryRecCt" (saved as an Access query) queries a recordset based on a form that is open and clearly gives the parameters needed >> form!frmCompetitor.txtYear and form!frmCompetitor.CompetitorID. Before showing a subform at the footer, I want to allow additions based on the number of records in the recordset of the subform.
I have this as the open_event for the subform:
Dim r As DAO.Recordset
Set r = CurrentDb.OpenRecordset("qryRecCt")
... and I get the "Too few parameters" error
I've also tried to construct the query in a string with the following:
strsql = "Select..."
set r = CurrentDb.OpenRecordset(strsql)
If r.Recordcount >0 then
....
else
endif
For some crazy reason the recordcount is off. If file through the records with:
r.movefirst
loop
str = r.fields(1)
r.movenext
loop
... etc and this works fine, it won't go past the number of records that the query is suppose to produce. In other words it gives me a recordcount of 3 but will only show 1 record when I try to loop through.
I'm at wits end. Can anyone help??
Should I be using ADO... I will be eventually using with with XP?
Why do I get an error of "Too few Parameters, expecting 2"
My query "qryRecCt" (saved as an Access query) queries a recordset based on a form that is open and clearly gives the parameters needed >> form!frmCompetitor.txtYear and form!frmCompetitor.CompetitorID. Before showing a subform at the footer, I want to allow additions based on the number of records in the recordset of the subform.
I have this as the open_event for the subform:
Dim r As DAO.Recordset
Set r = CurrentDb.OpenRecordset("qryRecCt")
... and I get the "Too few parameters" error
I've also tried to construct the query in a string with the following:
strsql = "Select..."
set r = CurrentDb.OpenRecordset(strsql)
If r.Recordcount >0 then
....
else
endif
For some crazy reason the recordcount is off. If file through the records with:
r.movefirst
loop
str = r.fields(1)
r.movenext
loop
... etc and this works fine, it won't go past the number of records that the query is suppose to produce. In other words it gives me a recordcount of 3 but will only show 1 record when I try to loop through.
I'm at wits end. Can anyone help??
Should I be using ADO... I will be eventually using with with XP?