Counting type in a subform

mtagliaferri

Registered User.
Local time
Today, 07:17
Joined
Jul 16, 2006
Messages
550
Hi I have a form showing me a list of records in datasheet view, every record can be expanded showing other records related to the main record also in a datasheet view, the subform records contain a field called "family" wich are A1, A2, C3. What I need is to show on the main form the number of records that belong to the A1 family, A2 family and C3 family, this result have to appear on 3 different text boxes on the main form!
 
Could you use something like

Dim li_AI_Count as Integer

li_A1_Count = DCount("*","tablename","Family = 'A1')

using the name of the table from which you're fetching the Family data.
Then assign this value to a field on your main form?

If so, you could repeat it for A2 and C3.
 

Users who are viewing this thread

Back
Top Bottom