".recordcount" in a control on a form?

  • Thread starter Thread starter RBear3
  • Start date Start date
R

RBear3

I have a form that randomly cycles through records. I have code that stores
the ".RecordCount" in a public variable called "NumOfRecs". I do this in
the form's open event.

How do I add a field to my form to show the number of records? Thanks!
 
RBear3 said:
I have a form that randomly cycles through records. I have code that
stores the ".RecordCount" in a public variable called "NumOfRecs". I do
this in the form's open event.

How do I add a field to my form to show the number of records? Thanks!


While you could set up a function to return the value of your public
variable, it's simpler to use this expression in your text box's
ControlSource expression:

=[Recordset].[RecordCount]
 
Thanks Dirk!!!

Thant was perfect.

--

RBear3
..

Dirk Goldgar said:
RBear3 said:
I have a form that randomly cycles through records. I have code that
stores the ".RecordCount" in a public variable called "NumOfRecs". I do
this in the form's open event.

How do I add a field to my form to show the number of records? Thanks!


While you could set up a function to return the value of your public
variable, it's simpler to use this expression in your text box's
ControlSource expression:

=[Recordset].[RecordCount]

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
RBear3 said:
Thanks Dirk!!!

Thant was perfect.


You're welcome. Note: I just read a post suggesting that this doesn't work
in Access 2007. I haven't tested that yet, but if you expect your database
to be used in that version, you may end up having to change the
controlsource.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top