Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ControlSource for TextBox

Status
Not open for further replies.

cwstektips

Programmer
Mar 26, 2002
4
US
Why won't the following work as the ControlSource for a TextBox in the Report Footer?

=Sum(IIf([PrtCd]=1,[AdjCash],0))

Produces the following error message:
2589: The expression 'Sum(IIf([PrtCd]=1,[AdjCash],0))' is invalid.
 
What datatype are PrtCd and AdjCash? There really isn't anything wrong with the expression. It should work just fine if PrtCd and AdjCash are not calculated textboxes in your Report.

Paul
 
PrtCd is int and AdjCash is dec. They are both fields in the recordset used as the RecordSource for the report. I'm doing an Access Project (SQL Server 2000 backend for data). I agree it should work. I've done a "workaround" but at this point am just curiuos as to why it doesn't work.
Thanks
 
Well, if this is an .adp file, I would say the IIF probably doesn't work although it could be either. I don't know for sure and I'd have to check this evening, but I know the Int() function won't work in an .adp app so it's possible one or both of those two functions isn't available either.
They might know over here

forum958


Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top