I want to write a function for a basic textbox in a form to display the amount of time a particular study appears in a table. I know I need the count function and an if statement but for some reason I get an error message when I try the following:
=COUNT(IIf(subject_study!study_name="Stroke","1","0"))
The subject_study table looks like the following:
patient_index study_name visit_id
1 Stroke 5012
2 Stroke 5013
3 Dyslexia 5014
4 Stroke 5015
....so basically I need to make a text box for each type of study, here there are only 2, "Stroke" and "Dyslexia" and I just need the textbox to display the total number, so for Dyslexia it should be 1 and for Stroke it should display "3". Any ideas what I'm doing wrong?
=COUNT(IIf(subject_study!study_name="Stroke","1","0"))
The subject_study table looks like the following:
patient_index study_name visit_id
1 Stroke 5012
2 Stroke 5013
3 Dyslexia 5014
4 Stroke 5015
....so basically I need to make a text box for each type of study, here there are only 2, "Stroke" and "Dyslexia" and I just need the textbox to display the total number, so for Dyslexia it should be 1 and for Stroke it should display "3". Any ideas what I'm doing wrong?