Re: Switch is overloaded!
From: Duane Hookom (duanehookom_at_NoSpamHotmail.com)
Date: 04/29/04
- Next message: Bill Taylor: "Re: SQL Statement"
- Previous message: Bill Taylor: "Re: Difference in days from multiple records"
- In reply to: Bonnie: "Switch is overloaded!"
- Next in thread: tina: "Re: Switch is overloaded!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 14:50:36 -0500
Yes, you are doing this in the wrong place. I would create a lookup table of
Div values and related values. Maintain the table rather than maintaining
your expression. If you can't do it the "data-driven" way, then create a
function:
Public Function GetGP(pstrDiv as String) as String
Select Case pstrDiv
Case "813"
GetGP = "2466"
Case "814"
GetGP = "2467"
'etc
End Select
End Function
You can then use an expression in your query like
GP:GetGP([Div])
-- Duane Hookom MS Access MVP -- "Bonnie" <Hambrick@discussions.microsoft.com> wrote in message news:62a301c42e1d$d63eb6a0$a301280a@phx.gbl... > Hi there! Using A02 in XP. Need to import some text with > Division numbers and need to convert them to the Contract > numbers so I can run an extract file. I have: > > GP: switch([Div]="813","2466", [Div]="814","2467", [Div] > ="815","2468", [Div]="816","2469", [Div]="817","2470", > [Div]="818","2471", [Div]="819","2472", [Div] > ="930","2455", [Div]="931","2456", [Div]="932","2457", > [Div]="933","2458", [Div]="934","2459", [Div] > ="935","2460", [Div]="936","2461", [Div]="938","2462", > [Div]="939","2463", [Div]="940","2464", [Div] > ="942","2465",true,[Div]) > > I get an error that the expression I entered is too > complex. Am I doing this in the wrong place? > > Thanks in advance for any help or advice. I luv u guys!!!
- Next message: Bill Taylor: "Re: SQL Statement"
- Previous message: Bill Taylor: "Re: Difference in days from multiple records"
- In reply to: Bonnie: "Switch is overloaded!"
- Next in thread: tina: "Re: Switch is overloaded!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|