Bound endless subform

  • Thread starter Thread starter Wilfried Poerschke
  • Start date Start date
W

Wilfried Poerschke

How to count the displayed records in a bound endless subform the simplest
way? (without displaying the navigationbuttons)

Thank You :-)
 
How to count the displayed records in a bound endless subform the simplest
way? (without displaying the navigationbuttons)

Thank You :-)

Put a textbox in the Subform' Footer or Header (you may need to use
View... Form Header and Footer in form design view to create these
areas); set its Control Source to

=Count(*)


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Hi John,

thank you so much! It works great, even if a little slow... ;-)

But, sorry, one question more:
I would like to have this Textbox in the parent form. Is it possible?
Or is there a simple way with VBA?

Thanks

Willi
 
Hi John,

thank you so much! It works great, even if a little slow... ;-)

But, sorry, one question more:
I would like to have this Textbox in the parent form. Is it possible?
Or is there a simple way with VBA?

Two possible ways to do it:

- Put the textbox in the Subform's footer or header; name it txtCount
(or txtDracula, depending on which count it is <g>); set its Visible
property (or that of the header/footer) to False; and put a textbox in
the mainform with a Control Source of

=Me!subformname.txtCount

- Or, count records dirctly in the table using the DCount() function
as the control source of a textbox:

=DCount("*", "[tablename]", "<criteria>")

where <criteria> is a valid SQL WHERE clause without the word WHERE,
returning the same records as are shown in the subform.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top