C
connieharper
I have a form that contains a calculated field. I want it
to display a total for all records in the tbl_accounting
table for the employee that is displayed on the form and
for the type displayed on the form. I have used the
following dsum statement in the controlsource property of
this field:
=DSum("[amount]","Tbl_accounting","[type] =[charge]"
And "[student_id] = [employeeid]")
It comes back with a grand total of all the records in the
table and doesn't limit the selection based on the TYPE or
the EMPLOYEE.
If I remove the AND part of the statement, it works. It
comes back with a total of all the records in the table
that have a TYPE = to the TYPE on the form. But I want to
also limit the selection of records to the employee who is
displayed on the form. I guess my syntax is wrong. Anyone
know what is wrong with it?
Thanks
to display a total for all records in the tbl_accounting
table for the employee that is displayed on the form and
for the type displayed on the form. I have used the
following dsum statement in the controlsource property of
this field:
=DSum("[amount]","Tbl_accounting","[type] =[charge]"
And "[student_id] = [employeeid]")
It comes back with a grand total of all the records in the
table and doesn't limit the selection based on the TYPE or
the EMPLOYEE.
If I remove the AND part of the statement, it works. It
comes back with a total of all the records in the table
that have a TYPE = to the TYPE on the form. But I want to
also limit the selection of records to the employee who is
displayed on the form. I guess my syntax is wrong. Anyone
know what is wrong with it?
Thanks