Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Counting records on a form (2002)

    I have a form w/a subform. I want to count the number of records on the subform. What I've done: In the subform query, I added a field called "CountMe". I created a text field on the form with CountMe as the control source. In the footer of the Subform I created an unbound text box and used "=Sum([Countme]) as the control source. Unfortunately, I'm not getting a total???? Ooops, forgot something. The field in the query says "Countme:1". Each textbox on the form has "1" displayed.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Counting records on a form (2002)

    Try setting the control source of the text box in the footer of the subform to <code>=Count(*)</code>

    If it works, you won't need the CountMe field in the query.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting records on a form (2002)

    Nope... I did a little experiment. I opened the subform by itself and the total appears.... is it possible you can't total the records in a subform?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Counting records on a form (2002)

    Oh yes, you can. I have several subforms in my databases showing a count of records using the method I described. What is displayed if you view the subform as a subform on a main form?

  5. #5
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting records on a form (2002)

    Nothing is displayed. The label says "Total Conditions:" with a blank next to it.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Counting records on a form (2002)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  7. #7
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting records on a form (2002)

    I'm still testing. I actually have two subforms on this form. the =Count(*) works fine on the other. When I put the same textbox in the sub form of the other, I don't get a count AND some kind of "flipping" thing is happening.... like it's sorting through all the reocrds. So, I think the problem is with my subform. I'm looking at the properities and will post a "stripped" version of the database IF I get stuck. "I'll be back..."

  8. #8
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting records on a form (2002)

    I figured out the problem.... And, I do thank you for your help here... As I said the form has 2 subforms...we'll call them "A" and "B". My goal was, when I clicked on a certain record in subform "A", I wanted subform "B" to show records associated with the change. To do this, I put a field on the form that passed the linking value from subform A to subform B. And that works just fine. But when I try to count the records it has a problem. I know this sounds confusing, I apologize for that. But, I do know where the problem is. Not sure if there is a solution or not... It may be more work than it is worth. Thanks.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Counting records on a form (2002)

    I don't think I can give advice without seeing (a stripped down version of) the database, so...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •