I'm not sure the best way to word what I am trying to do.
I have a database table which collects feedback data on some training courses my company provides. We track feedback on 3 different instructors and attendees answer 4 questions, each response is either excellent, very good, good, fair or poor. I have created a form connected to a table to collect the counts all of the (excellent, very goods, goods, etc) for each instructor. I'm not extremely versed in VBA but I can usually get by. However, currently the code I am using would require me to type out something similar to:
for each instructor and each answer to 4 questions. Not my idea of fun. How can I consolidate this to shorten the length of my VBA code and the time it takes to calculate?
I have been looking around and it seems like I can do the following:
But ... when it gets to the criteria part of it, I am at a loss. AND, OR, & and + don't seem to give me what I want when I'm trying to get it to count each 'excellent' or whatnot in columns 1, 2, 3 and 4.
So, after this incoherent ramble, I'm hoping someone can help me. The answer is probably pretty simple and right in front of my nose.
I have a database table which collects feedback data on some training courses my company provides. We track feedback on 3 different instructors and attendees answer 4 questions, each response is either excellent, very good, good, fair or poor. I have created a form connected to a table to collect the counts all of the (excellent, very goods, goods, etc) for each instructor. I'm not extremely versed in VBA but I can usually get by. However, currently the code I am using would require me to type out something similar to:
Code:
x = dcount ("i1_1", "my_query or table", "Class = Forms!my_form!Class AND i1_1='excellent'
x = dcount ("i1_2", "my_query or table", "Class = Forms!my_form!Class AND i1_2='excellent'
x = dcount ("i1_3", "my_query or table", "Class = Forms!my_form!Class AND i1_3='excellent'
x = dcount ("i1_4", "my_query or table", "Class = Forms!my_form!Class AND i1_4='excellent'
I have been looking around and it seems like I can do the following:
Code:
dcount("[i1_1 & i1_2 & i1_3 & i1_4]", "my_query", "[Class] = Forms!my_form!Class ... "
So, after this incoherent ramble, I'm hoping someone can help me. The answer is probably pretty simple and right in front of my nose.
Comment