Corrected Syntax

  • Thread starter Thread starter Bill
  • Start date Start date
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)
 
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))
 
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))
 
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))
 
Back
Top