Link to home
Start Free TrialLog in
Avatar of Jeannie Cote
Jeannie Cote

asked on

IFF expression for an Access report

Hi,
I have a report on which there is a control called CtrlCode, if the information in this control ends with an X, I need the information already in control AccessTotalsSumOfWeight to be copied in control Total_X
I tried the following formula:
= IIF([CtrlCode] Like "*X","[AccessTotalsSumOfWeight]"
I get a mismatch

Any help would be greatly appreciated
Thanks
Jeannie
Avatar of PatHartman
PatHartman
Flag of United States of America image

It would be easier to do this in the report's RecordSource query.  But we don't know what the result is supposed to be when the CtrlCode does not end with "x"

Select fld1, fld2, fld3, Iif(Right(CtrulCode, 1) = "X", AccessTotalsSumOfWeight, somethingelse) As Total_X from yourtable;

Then you can bind Total_X to the report control.
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeannie Cote
Jeannie Cote

ASKER

Thank you both for your help !