If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Expressions/Functions
I am new to Access and what I know is self taught from the website, so I
appologize if this is a stupid question... I have a field [REASON CODE] that is a drop down box containing the following options: FML, PER, WC, MIL, FMLInt I have two other fields ([BCBS Due] and [COBRA Due]) that contain working expressions, are numeric, and are the sum of several other fields. In the billing section of my form, I am trying to write an expression for the amount due based on the above information. The information listed below is true: If reason code=FML, payment due=BCBS due If reason code=PER, payment due=COBRA due If reason code=WC, payment due=0 If reason code=FMLInt, payment due=NA If reason code=MIL, payment due=Company Paid There are no other outcomes, however i will need to add to these expressions for the remaining payment due amounts. I think i could figure out the others if i had the first one. i don't know what would be best, an IIF/switch function or what... HELP PLEASE! -- Shannon Granstaff |
#2
|
|||
|
|||
Expressions/Functions
Hi Shannon,
The Switch() function is easier to write and read when dealing with your type of situation. For that reason, I would use it. Clifford Bass "sgranstaff" wrote: I am new to Access and what I know is self taught from the website, so I appologize if this is a stupid question... I have a field [REASON CODE] that is a drop down box containing the following options: FML, PER, WC, MIL, FMLInt I have two other fields ([BCBS Due] and [COBRA Due]) that contain working expressions, are numeric, and are the sum of several other fields. In the billing section of my form, I am trying to write an expression for the amount due based on the above information. The information listed below is true: If reason code=FML, payment due=BCBS due If reason code=PER, payment due=COBRA due If reason code=WC, payment due=0 If reason code=FMLInt, payment due=NA If reason code=MIL, payment due=Company Paid There are no other outcomes, however i will need to add to these expressions for the remaining payment due amounts. I think i could figure out the others if i had the first one. i don't know what would be best, an IIF/switch function or what... HELP PLEASE! -- Shannon Granstaff |
Thread Tools | |
Display Modes | |
|
|