count records with multiple criteria in VBA

jeannier1975

Registered User.
Local time
Today, 03:22
Joined
May 17, 2018
Messages
48
I have many queries were simply to come up with a number that is a count of records with a specific criteria, to be used later in a calculation. Because those criteria are so lengthy, and change with each variation of the data that is collecting, I’m not sure if an IIF structure would return the results you want. Crosstab queries can get quirky when fields are not available on different data runs. I want to do most (if not all) of the count-collecting in VBA using recordsets or the DCOUNT() function. Then I want dumping the values into a temporary table and base the report off of that. The queries I already have built are doing pretty much what I described, but when you try to link them together for the final report, if anything had missing or null values, it causes problems. Doing the work in VBA gives me much more flexibility in handling these situations.
 
I moved your thread out of the moderated sample databases forum. I'm not seeing a specific question. Were you just providing this as a potential solution for others?
 
Hi. Did you need help with the VBA code you're trying to build? What do you have so far?
 
i'm trying to build a function the counts the records with multiple criteria and divide theat criteria with some count of another criteria to get a percentage. I don't know VBA so i need help.
 
i'm trying to build a function the counts the records with multiple criteria and divide theat criteria with some count of another criteria to get a percentage. I don't know VBA so i need help.
Okay, can you post a sample copy of your database with test data only? Please tell us which tables and which fields to count and also tell us the criteria you want to use.
 

Users who are viewing this thread

Back
Top Bottom