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

How to know the total number of records

P: 2
Hi there,
I am trying to get the total number of records when i am working on a form to write the VB code. But still, I have not found any function that shows it. Could anyone help?
Thank you,
Smith.
Aug 20 '06 #1
Share this Question
Share on Google+
5 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
If you open a Recordset (rs) then rs.RecordCount will give you the total number of records.

If you don't know how to handle DAO recordsets have a look at this page:

http://msdn.microsoft.com/archive/de...ml/web/011.asp
Aug 21 '06 #2

P: 2
Thank you, i was pretty confused about DAO before
Smith
Aug 21 '06 #3

ADezii
Expert 5K+
P: 8,632
Try Me.RecordsetClone.RecordCount and assign this result to an Integer
variable

Hope This Helps
Aug 23 '06 #4

100+
P: 179
The easiest function to use is the Count() function. If you cna't figure out how to use it on MS Access help, let me know, and I'll explain it. It's pretty straightforward.

comteck
Aug 23 '06 #5

100+
P: 179
I forgot to mention that the Count() function is not normally used as part of VB programming. Create a textbox, and put in the Control Source:

=Count(fieldname )

You can use any field from the underlying table, as long as it is on the form.

comteck
Aug 23 '06 #6

Post your reply

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