Hi All,
I am new to Access and VBA and I am having trouble getting a count in a subreport.
I have a table named "companies" and a query named "clients" The clients are linked to our different companies. Both have a field named "country" which is linked to a table with all the existing countries.
I have created a report based on the "companies" table. The subreport is based is the "client" query and shows all clients for each company. So far so good.
In the report footer I want to create a count for all clients that are based in "Netherland s" and all clients that are not.
I tried: =DCount("[country]";"[client]";"[country] = 'Netherlands' ")
This doesn't work. This returns #error. I tried with brackets, without brackets, comma's etc, but all return the same.
I have also tried:
=Som(Abs([country]="Netherlands") )
and
=Som(IIf([country]="Netherlands"; 1;0))
these return the following message:
"This expression has a spelling error or is too complex for evaluation.
A numeric expression could contain to many complex elements.
Try to simplify the expression by assigning several parts to variables."
What am I doing wrong?
I am new to Access and VBA and I am having trouble getting a count in a subreport.
I have a table named "companies" and a query named "clients" The clients are linked to our different companies. Both have a field named "country" which is linked to a table with all the existing countries.
I have created a report based on the "companies" table. The subreport is based is the "client" query and shows all clients for each company. So far so good.
In the report footer I want to create a count for all clients that are based in "Netherland s" and all clients that are not.
I tried: =DCount("[country]";"[client]";"[country] = 'Netherlands' ")
This doesn't work. This returns #error. I tried with brackets, without brackets, comma's etc, but all return the same.
I have also tried:
=Som(Abs([country]="Netherlands") )
and
=Som(IIf([country]="Netherlands"; 1;0))
these return the following message:
"This expression has a spelling error or is too complex for evaluation.
A numeric expression could contain to many complex elements.
Try to simplify the expression by assigning several parts to variables."
What am I doing wrong?
Comment