Bound endless subform

  • Thread starter Wilfried Poerschke
  • 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 :)
 
J

John Vinson

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
 
W

Wilfried Poerschke

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
 
J

John Vinson

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
 

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

Top