Too few parameters in openrecordset line

Roni Sutton

Registered User.
Local time
Today, 19:08
Joined
Oct 18, 1999
Messages
68
Here's the code:

dim db as database
dim rst as recordset

set db = currentdb()
set rst = db.openrecordset("qryGroup")

It bombs out on the set rst statement with a 'too few parameters' error message. As I've played with it, if I put a query name in that has records in it, I don't get the error. However, any query in my db that has no records results in this error. Since I want to error trap an empty record set, I need to be able to follow the rst with a decision loop dependant upon whether or not the recordset is empty. My Access bible gives me sample code, but I can't get past setting the record set. Any ideas? I looked through other posts and saw one where someone was using an SQL string and got the same error message, but I know I haven't misspelled a field b/c I'm using a query that runs. It's just that sometimes it has data and sometimes not.

HELP!!

Roni
 
Try this:

If DCount("*", "qryGroup") <1 Then
MsgBox "There is no data in the query"
Exit sub
End If

dim db as database
dim rst as recordset

set db = currentdb()
set rst = db.openrecordset("qryGroup")

Hope this works for you....

Jack
 

Users who are viewing this thread

Back
Top Bottom