jazminecat23
Programmer
I have a report based on the following query:
I want to use an IIF function in my textbox, to look at the Tbl_suppl_Obj.Object_Code. If that data has a decimal in it, as in xxxx.xxx, then I want it to only show the Object_Code. If it doesn't have that, I want the text box to show the Object_Code, a decimal, and then the Sub_Obj_Code.
I have used this code in another report as follows:
this works perfectly.
But i can't get it to work on this new report. It gives me an #error every time. I can get it to show either the Object_Code or the Sub_Obj_Code, but not to look at it and do the above logic.
Can anyone see what I"m missing here? Thanks!
Code:
SELECT Tbl_suppl_main.reqType, Tbl_suppl_main.supplID, Rights.[Unit ID], Rights.Department, Rights.Division, Tbl_suppl_main.Fund, Tbl_suppl_main.Attachment, Tbl_suppl_main.CostCntr, Tbl_suppl_main.Originator, Tbl_suppl_main.Name_Request, Tbl_suppl_main.Data_Entry_Date, Tbl_suppl_main.Descrip_Requested, Tbl_suppl_main.Objectives, Tbl_suppl_main.Ongoing, Tbl_suppl_main.Personnel, Tbl_suppl_main.Priority, Tbl_suppl_Obj.Object_Code, Tbl_Obj_Codes.Object_Descr, Tbl_suppl_Obj.Amount, Tbl_ASR_ExpType.Exp_Type, Tbl_ASR_status.Status, Tbl_suppl_main.Problem, Tbl_suppl_main.Customer, Tbl_suppl_main.Need, Tbl_suppl_main.CustService, Tbl_suppl_main.Advantages, Tbl_suppl_main.Outcomes, Tbl_suppl_main.OutcomeDate, Tbl_suppl_main.Measure, Tbl_suppl_main.Impacts, Tbl_suppl_main.WhoResponsible, Tbl_suppl_main.WhoMeasures, Tbl_suppl_main.OtherKeyPlayers, Tbl_suppl_main.PotentialFunding, Tbl_suppl_main.Flag_Space, Tbl_suppl_main.Addl_FTE, Tbl_suppl_Obj.Approved_Amt, Tbl_suppl_Obj.Final_Amt, Tbl_suppl_main.yearno, tbl_supplyearno.Year, Tbl_suppl_main.Exec_Approv_Status, Tbl_suppl_Obj.Sub_Obj_Code
FROM (((Tbl_suppl_Obj RIGHT JOIN ((Tbl_suppl_main LEFT JOIN Tbl_ASR_ExpType ON Tbl_suppl_main.Ongoing = Tbl_ASR_ExpType.Exp_Type_Code) INNER JOIN Rights ON Tbl_suppl_main.UnitID = Rights.[Unit ID]) ON Tbl_suppl_Obj.supplID = Tbl_suppl_main.supplID) INNER JOIN Tbl_ASR_status ON Tbl_suppl_main.Exec_Approv_Status = Tbl_ASR_status.Status_Code) LEFT JOIN Tbl_Obj_Codes ON Tbl_suppl_Obj.Object_Code = Tbl_Obj_Codes.Object_Code) INNER JOIN tbl_supplyearno ON Tbl_suppl_main.yearno = tbl_supplyearno.Yearno
WHERE (((Tbl_suppl_main.Exec_Approv_Status)=1))
ORDER BY Rights.Division
WITH OWNERACCESS OPTION;
I want to use an IIF function in my textbox, to look at the Tbl_suppl_Obj.Object_Code. If that data has a decimal in it, as in xxxx.xxx, then I want it to only show the Object_Code. If it doesn't have that, I want the text box to show the Object_Code, a decimal, and then the Sub_Obj_Code.
I have used this code in another report as follows:
Code:
=IIf([Object_Code] Like "*.*",[Object_Code],[Object_Code] & "."+[Sub_Obj_Code])
this works perfectly.
But i can't get it to work on this new report. It gives me an #error every time. I can get it to show either the Object_Code or the Sub_Obj_Code, but not to look at it and do the above logic.
Can anyone see what I"m missing here? Thanks!