By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,560 Members | 1,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,560 IT Pros & Developers. It's quick & easy.

How to retrieve the recordcount from a named query? Help please

P: 1
I need to dynamically switch two named queries to a Form as recordsource. But one of the query might not produce any record on run-time. I want to test the recordcount of that query at run-time before assigning to the form as recordsource. I tried to use a recordset variable rst...

set rst = db.openrecordset(QueryName)
rst.recordcount

but it didn't work, it says "Too Few parameter, expecting 2", any idea?
Thank you!
Oct 13 '06 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 1,221
Do you mean to say you queried the recordcount with something like this?

if rs.RecordCount = 0 Then
MsgBox "Please build 'Order' counter in table tblParameters"

I use this instruction frequently. This should work for you. If this is what you're doing and it does not work, post more of your code so we can see exactly what's going on.

Jim
Oct 14 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.