Corrected 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)
 
M

Marshall Barton

Bill said:
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)


Try this expression:

=Sum(IIf(jobno=forms!frmFPISelect1!txtjob1, Abs([FPI]=5, 0))
 
B

bill

I got the following error message when I tried this:

"The expression you entered has a function containing the
wrong number of arguments"
-----Original Message-----
Bill said:
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)


Try this expression:

=Sum(IIf(jobno=forms!frmFPISelect1!txtjob1, Abs([FPI]=5, 0))
 
M

Marshall Barton

Arrggghhh, I was missing a parenthesis. Try again:

=Sum(IIf(jobno=forms!frmFPISelect1!txtjob1, Abs([FPI]=5),
0))


I got the following error message when I tried this:

"The expression you entered has a function containing the
wrong number of arguments"
-----Original Message-----
Bill said:
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)


Try this expression:

=Sum(IIf(jobno=forms!frmFPISelect1!txtjob1, Abs([FPI]=5,
0))
 

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

Correct Syntax 1
Wrong syntax 4
IIF Statement 1
Access Dcount (multiple criteria) 3
how to program a single field in report 26
dlookup or dsum 4
Group totals on a report 2
Report Equation Access 2003 6

Top