Correct Syntax

B

Bill

Can anyone provide me with the correct syntax for the
control source of a report text box. Below is what I
want to do, but I keep getting syntax errors

jobno is text field in a query
txtjob1 is a text field in a form
FPI is a numeric field in the same query

=sum(Abs([FPI]=5)) where (jobno = forms!frmFPISelect1!
txtjob1)

Any help would be greatly appreciated

Thanks
Bill
 
J

Jennifer Hoyte

You need to use the Domain aggregate function: DSum.
That takes 3 parameters, the field to sum, the
table/query to look in, and the criteria. The parameters
need to be quoted. You will then need to enter your
criteria with quotes since jobno is text like
this: "jobno = '" & forms ... & "'"
Hope this helps. j.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Corrected Syntax 3
Wrong syntax 4
IIF Statement 1
dlookup or dsum 4
Search Button to find any part of field 2
Finding Duplicate Values 2
VB.NET Datasets 0
Access Dcount (multiple criteria) 3

Top