Re: Select Case Problem
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Fri, 11 Aug 2006 10:57:39 -0400
Generally case can only evaluate ONE variable.
How about rewriting the function as follows?
Function RowDesig2(AcctLvl1 As String, FuncGroup As String, Prod As String)
IF AcctLvl1 <> "Revenue" And _
FuncGroup = "Operations" And Prod <> "999" THEN
RowDesig2 = "DIRECT OPS EXPENSE"
ELSEIF AcctLvl1 <> "Revenue" And _
FuncGroup = "Products" And Prod = "999" THEN
RowDesig2 = "INDIRECT OPS EXPENSE"
ELSEIF AcctLvl1 <> "Revenue" And _
FuncGroup <> "Operations" And FuncGroup <> "Products" THEN
RowDesig2 = "OTHER SGA - SHARED SERVICES"
ELSE
RowDesig2 = "SOME OTHER DESIGNATION"
END IF
End Function
"Kirk P." <KirkP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BD59F70C-1FCF-4FED-A446-4F1EA0A6A435@xxxxxxxxxxxxxxxx
This Select Case statement isn't returing the desired results. I'm trying
for, in case 1, when the expression evaluates to True, return "Direct Ops
Expense". What am I doing wrong?
Function RowDesig2(AcctLvl1 As String, FuncGroup As String, Prod As
String)
Select Case RowDesig2
Case [AcctLvl1] <> "Revenue" And [FuncGroup] = "Operations" And [Prod]
<> "999"
RowDesig2 = "DIRECT OPS EXPENSE"
Case [AcctLvl1] <> "Revenue" And [FuncGroup] = "Products" And [Prod] =
"999"
RowDesig2 = "INDIRECT OPS EXPENSE"
Case [AcctLvl1] <> "Revenue" And [FuncGroup] <> "Operations" And
[FuncGroup] <> "Products"
RowDesig2 = "OTHER SGA - SHARED SERVICES"
Case Else
RowDesig2 = "SOME OTHER DESIGNATION"
End Select
End Function
.
- Prev by Date: Re: Make-Table from Multi-Select Listbox?
- Next by Date: Re: How Does Access Update Fields Within Rows?
- Previous by thread: Re: Excel vs Access?
- Next by thread: RE: e-mail HTML messages
- Index(es):