|
Question : Count records in subform meeting criteria
|
|
I have a main form, with a sub form, linked by ClientID. I would like to have a text box in the subform to display the count of records within the subform that meet one criterion.
Main form - Clients, PK ID Subform - Appointments, PK AppointmentID, FK ClientID
I would like the text box to show count of AppointmentID where Attendance = "Attended".
|
|
Answer : Count records in subform meeting criteria
|
|
In the subform put in a control in th form header or footer called txtCOUNT with a control source of =SUM(IIF(Attendance = "Attended",1,0))
Then in your main form create another textbox with a controlsource of =[SubformControlName].Form!txtCOUNT
Cheers, Andrew
|
|
|
|