Re: Need calculated control to work

Tech-Archive recommends: Fix windows errors by optimizing your registry



The simplest way to do this is to set the subform's NavigationButtons property to Yes. The left end of the horizontal scrollbar will then display something like:
4 of 199 records

If you don't want to do that, life is not so simple. If the form is in Form view or Continuous View, you could add a text box to its Form Footer section, and set the Control Source to:
=[Form].[Recordset].[RecordCount]

However, several things can go wrong with that:

a) It may initially show 1 for a while when the form first loads. This is because it takes Access some time to load the form's records, and some further time before it must update this text box.

b) This fails in Access 2007, where you must write a function to get the count.

c) In older versions (before Access 2000) you might need to use:
=[Form].[RecordsetClone].[RecordCount]

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"JJ" <jj@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B031C326-5E4E-421F-BF3D-A84D9E2EBA5B@xxxxxxxxxxxxxxxx
I have a subform with fields: first name, last name, phone, expiration date,
membership status. I want a calculated control to display the total number of
records that appear in the subform. How do I do this?
--
jj

.


Quantcast