A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

".recordcount" in a control on a form?



 
 
Thread Tools Display Modes
  #1  
Old February 7th, 2008, 04:36 PM posted to microsoft.public.access.forms
RBear3
external usenet poster
 
Posts: 242
Default ".recordcount" in a control on a form?

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!

--
Hope that helps!

RBear3
..


  #2  
Old February 7th, 2008, 04:49 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default ".recordcount" in a control on a form?

"RBear3" wrote in message
...
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)

  #3  
Old February 7th, 2008, 05:40 PM posted to microsoft.public.access.forms
RBear3
external usenet poster
 
Posts: 242
Default ".recordcount" in a control on a form?

Thanks Dirk!!!

Thant was perfect.

--

RBear3
..

"Dirk Goldgar" wrote in message
...
"RBear3" wrote in message
...
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)



  #4  
Old February 7th, 2008, 06:09 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default ".recordcount" in a control on a form?

"RBear3" wrote in message
...
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.

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

(please reply to the newsgroup)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.