number records in subform

  • Thread starter Thread starter Steven Greenberg
  • Start date Start date
S

Steven Greenberg

Greetings,

I have a main form with students information with a subform for all their
data such as meetings with them. I have a report that I print which numbers
their records using a trick I read in the book where I use a text box set
to =1 then use the running sum to increment the text box for each line.
I would like to extend that to my subform so I can tell the number of the
session. There is no equivalent running sum in the form and I can't come up
with anything using VBA (which up till now, I thought I was pretty good at)
to accomplish this. It is not a critical thing I need to do, I just thought
if it was possible, I would like to implement it.

Any suggestions or links to similar situations would be appreciated.
Thanks
Steve
 
Simplest thing is to turn on the Navigation Buttons for the subform.
This appears at the left end of the subform's horizontal scrollbar, and
shows you the number of records.

Alternatively, add a text box to the Form Footer section of the subform, and
set its ControlSource to:
=Count("*")
If the subform is in Continuous View, that's all you need. If it is in
Datasheet, you have to bring the number back onto the main form with another
text box that has a Control Source of something like this:
=[MySub].[Form].[txtCount]

Third alternative, on the main form:
=[MySub].[Form].[RecordsetClone].[RecordCount]
 
Simplest thing is to turn on the Navigation Buttons for the subform.
This appears at the left end of the subform's horizontal scrollbar,
and shows you the number of records.

Alternatively, add a text box to the Form Footer section of the
subform, and set its ControlSource to:
=Count("*")
If the subform is in Continuous View, that's all you need. If it is in
Datasheet, you have to bring the number back onto the main form with
another text box that has a Control Source of something like this:
=[MySub].[Form].[txtCount]

Third alternative, on the main form:
=[MySub].[Form].[RecordsetClone].[RecordCount]

I tried the navagation buttons and it does work but I don't like the look
of it. As a matter of fact, I created a set of custom ones on the main
form. I will try your other suggestions which I have tried in some form or
another but it never work, I kept getting a blank text box.
Thanks
Steve
 
Back
Top