I am trying to count the number of records in an Access database table based on double criteria. Here goes:
child = DCount("[Status]", "[othersinhousehold]", "[Status] = 'Child'" And "[customerid] = " & "'" & ID & "'")
"Status" is either "Child" or "Adult"
"customerid" is based on the ID of the Customer in the "Customers" table.
Trying to tally how many children and how many adults live with the customer.
"Othersinhousehold" is a table linked to "Customers" via Customerid field.
With the above dCount Statement, I receive "Type Mismatch" error.
Child is Integer
child = DCount("[Status]", "[othersinhousehold]", "[Status] = 'Child'" And "[customerid] = " & "'" & ID & "'")
"Status" is either "Child" or "Adult"
"customerid" is based on the ID of the Customer in the "Customers" table.
Trying to tally how many children and how many adults live with the customer.
"Othersinhousehold" is a table linked to "Customers" via Customerid field.
With the above dCount Statement, I receive "Type Mismatch" error.
Child is Integer