Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 2nd, 2006, 03:29 AM
Authorized User
Join Date: Apr 2006
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default Show number of records

I have created a form with a comand button!
This command button shows me specific records (combination 2 tables) of a huge data base!
Is it possible to add a text box or anything else which can shows me how many records shows me in the result form when I push the command button!?

Vision G

Old June 2nd, 2006, 07:27 AM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

There are a lot of ways to do this, one of which is to open a recordset on the tables and then add the recordcounts from each one to a variable, and then post the variable in a control or message box.
There is probably a system table with this value as well.

Old June 3rd, 2006, 03:01 AM
Authorized User
Join Date: May 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ashfaque

If you need to count the records at all the times from your subform then place an unbound textbox on your main form and write following code into it.

=Forms!MainFormNameHere!SubFormNameHere.Form.Recor dsetClone.RecordCount

If you need to count displayed records from Main form then remove "SubFormNameHere" & perhaps need to remove ! or . from the above.

Incase you need this to be carried out upon clicking the button then clear the code from the text box and write (almost) same code in OnClick event of the command button

Text0=Forms!MainFormNameHere!SubFormNameHere.Form. RecordsetClone.RecordCount

(Text0 is your textbox name)

It should produce the desired result.


Similar Threads
Thread Thread Starter Forum Replies Last Post
show records with only values dstein4d Access VBA 1 September 2nd, 2008 04:59 PM
Show ALL records from one table janise MySQL 1 September 1st, 2005 06:08 PM
Doesn't show all records from a table janise Access 10 July 27th, 2005 04:19 AM
Number of records Pharasite Classic ASP Databases 4 July 1st, 2004 02:00 AM
show the record number yami56 Access 9 April 5th, 2004 08:35 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.