Hallo,
I have a problem with the dcount function.
There are two tables: tbl_Organization and tbl_Otype (organization and organization type). They are linked by the field Org_OtypeID. The aim now is to have a continuous form where I can display the number of organization of each type. So what I did is a form with source in the tbl_Otype table. In the form I show the type (Oty_Type) and the type ID (Oty_ID). Now it comes the dcount function: I would like it to count the records in Organization table that match with the type ID in the form... in other words:
=DCount("[Org_OTypeID]";"tbl_Organization";"Org_OTypeID='" & [Oty_ID] & "'")
It should count the typeID field in the organization table, but only if it match with the typeID (from Type table) in the form... but it says that there is a data type mismatch.
Does someone have a suggestion? thanks
NB: I put the code as a control source of a textbox and not in VBA
I have a problem with the dcount function.
There are two tables: tbl_Organization and tbl_Otype (organization and organization type). They are linked by the field Org_OtypeID. The aim now is to have a continuous form where I can display the number of organization of each type. So what I did is a form with source in the tbl_Otype table. In the form I show the type (Oty_Type) and the type ID (Oty_ID). Now it comes the dcount function: I would like it to count the records in Organization table that match with the type ID in the form... in other words:
=DCount("[Org_OTypeID]";"tbl_Organization";"Org_OTypeID='" & [Oty_ID] & "'")
It should count the typeID field in the organization table, but only if it match with the typeID (from Type table) in the form... but it says that there is a data type mismatch.
Does someone have a suggestion? thanks
NB: I put the code as a control source of a textbox and not in VBA