Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 26th, 2006, 08:23 AM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Counting records

Hello everyone,

Im having a problem getting access to count the correct number of records when i run a report. The problem is that i have a subform within a main form, subform records payments made to an account, and instead of counting the 1 record from the main form it counts the many (20 in some cases) records in the subform. i am totally stumped on this one, any help is appreciated.

  #2 (permalink)  
Old July 27th, 2006, 12:40 PM
Authorized User
 
Join Date: Apr 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Create a query that does your count, then add the result as a field in your form.

  #3 (permalink)  
Old July 31st, 2006, 08:16 AM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx Trab, but i do know how to count records but this time im havin trouble, ill give u a better idea of wut im talkin about.

i have a form in which insurance claims are entered (including name, address date of loss etc..) and i have subforms within that form in which payments for that claim have been made. now, wen i run the query instead of giving me, say, claim 1, 2 and 3, it will give me all the payments made for that claim, so wen i do sumthin like count claims it will give me 100 instead of 3..any ideas?

  #4 (permalink)  
Old August 3rd, 2006, 12:22 PM
Registered User
 
Join Date: May 2004
Location: Lansing, KS, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not sure if you've found you're answer yet, but are you using VBA or an object event to perform the count? if either, how does your statement appear? Also, where are you performing the count in the report, detail page, report footer...? If you're using a query for the count, make sure it isn't the same query, if used, for the subform. The count shouldn't have anything to do with the form or subform, but rather the report objects.

Mel Cape
  #5 (permalink)  
Old August 4th, 2006, 09:07 AM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey mel thanks for the tip. ill give the other forums a shot, but since im here how would i be able to count report objects? because i have tried using a count function on the report footer but it gives me the same kind of problem. but counting report items seems right because my report looks fine, just a matter of gettin the correct count to appear.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Child Records BrianWren VB Databases Basics 1 June 2nd, 2008 04:32 PM
Counting 'groups' of records in a report Odeh Naber Access 4 July 30th, 2007 10:41 AM
AbsolutePosition counting filtered records Brad_S VB Databases Basics 1 August 17th, 2006 04:24 AM
A Cursor counting records chubnut SQL Server 2000 12 July 8th, 2004 01:58 PM
Grouping and Counting records Con Access VBA 1 September 17th, 2003 11:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.