Hello,
I have an application, which i need to modify, 1 line is really long, so when I add additional condition to it, the program gives an error. I was looking for options to re write it and make it shorter:
i thought about 'select case', or putting some values into variable, like this :
But no luck
I'll appreciate your help
thanks
Tali
I have an application, which i need to modify, 1 line is really long, so when I add additional condition to it, the program gives an error. I was looking for options to re write it and make it shorter:
Code:
Me.RecordSource = "SELECT JobOrder.*, IIf([ShipType]=""1"",""ground"",IIf([ShipType]=""2"",""air"")) AS ShipText, IIf([PackType]=""1"",""skid(s)"",IIf([packtype]=""2"",""carton"")) AS PackText, TotalTax, Store.City, Store.PostalCode, Store.StoreName, Int(ReturnMax([weight],[dimweight])+1) AS BillWeight, IIf([ProvinceState].[Region]=""E"",1,IIf([ProvinceState].[Region]=""O"",2,IIf([ProvinceState].[Region]=""U"",3,4))) AS RegionSort, IIf([ProvinceState].[Country]=""CAN"",1,IIf([ProvinceState].[Country]=""USA"",2,3)) AS CountrySort FROM (JobOrder LEFT JOIN Store ON JobOrder.StoreNo = Store.StoreNo) LEFT JOIN ProvinceState ON Store.Province = ProvinceState.StateID WHERE (((JobOrder.JobNo)=[forms]![fdreportjoborder]![jobflt])" & ordflt & ");"
Code:
TotalTax = ntz([GSTAmount]) + ntz([PSTAmount]) + ntz([HSTAmount]) + ntz([NSHAmount])
I'll appreciate your help
thanks
Tali
Comment