EricTheRed
Registered User.
- Local time
- Today, 07:44
- Joined
- Aug 7, 2003
- Messages
- 27
Another question / yes indeed / some brilliant answers / that's what I need.
Sorry, but it's been a long day. You can't blame an aspiring poet!
Anyhow, I'm having trouble counting records. Here's the situation: For every person in my database, there is either zero, one, or two sets of "contact information" associated with him or her. This information is displayed as a subform on the primary "person" form. I'd like to be able to determine (from inside the subform) the number of contact information records associated with each person. Is there any easy way to accomplish this? I have tried "Me.Recordset.RecordCount", however it requires one to iterate through all the records before it produces an accurate result.* "DCount" is also an option, although I don't want to have to sift through the entire table (several thousand records eventually) to divine the existence of one or two. Currently I'm using
While Not Me.Recordset.EOF
Me.Recordset.MoveNext
Wend
followed by RecordCount to determine the number of records. This, however, strikes me as a somewhat ugly solution. Is there some better way I could be doing this? Thanks in advance for any help.
* This produced much frustration. Grr. I was very confused to have it calmly report the existence of only one record when I was very, very sure there were two.
Sorry, but it's been a long day. You can't blame an aspiring poet!
Anyhow, I'm having trouble counting records. Here's the situation: For every person in my database, there is either zero, one, or two sets of "contact information" associated with him or her. This information is displayed as a subform on the primary "person" form. I'd like to be able to determine (from inside the subform) the number of contact information records associated with each person. Is there any easy way to accomplish this? I have tried "Me.Recordset.RecordCount", however it requires one to iterate through all the records before it produces an accurate result.* "DCount" is also an option, although I don't want to have to sift through the entire table (several thousand records eventually) to divine the existence of one or two. Currently I'm using
While Not Me.Recordset.EOF
Me.Recordset.MoveNext
Wend
followed by RecordCount to determine the number of records. This, however, strikes me as a somewhat ugly solution. Is there some better way I could be doing this? Thanks in advance for any help.
* This produced much frustration. Grr. I was very confused to have it calmly report the existence of only one record when I was very, very sure there were two.