I have two tables, tblPractices and tblProviders. In tblPractices is a field, NumProv, which indicates how many providers are ACTIVE for the practice. Unfortunately this field is not always updated when we make changes to the tblProviders, Active/Inactive field.
I have went into query design and used both tables with Totals. I pulled all fields from tblPractices and only the Active/Inactive from tblProviders. All are set to Group by except NumProv(tblPractices) is set to Count and Active/Inactive (tblProviders) has Criteria set to "Active". When I run this query it shows me all Practices with only Active providers. Unfortunately, we have some practices in pending status so those providers are marked as Inactive, and thus the practice is no populated.
I am trying to have NumProv automatically calculate the number of Active providers based on the tblProviders Active/Inactive and also show practices in pending with providers marked Inactive.
I have also used the DCount
Code:
=DCount("[Num Prov]","tblProviders","[Active/Inactive]='Active'")
but it returns 0 for each record.
Am I missing something?