Count matching records from a subform. Please help...

  • Thread starter Thread starter elguapo
  • Start date Start date
E

elguapo

Guest
I need to have the sum of the "matching records" of a subform, exported to a variable of the main form, in order to use it in an if condition.

e.g. "IF a client has brought X? times the vehicle A for a service of type B, THEN do ..."
How do I get the X value in a variable within the main form which presents all activity for all clients (by means of a subform).

I hope this is clear.
Plaese help me, guys. You 've done it before, you're so great!
 
Either:
Create a recordset in code that matches the subform's.
-or-
Add a form footer to your subform, add a text box to that, make the control source "=Sum([MyField])"...you can refer to that control in code to get its value.
...at least I think that will work. Let me know.
 
Or use DCount()
 

Users who are viewing this thread

Back
Top Bottom