Re: Switch is overloaded!

From: Duane Hookom (duanehookom_at_NoSpamHotmail.com)
Date: 04/29/04


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!!!


Relevant Pages

  • Writing an Adventure game with HLA
    ... For an "adventure" style game, ... These two routines lexically scan13 a string and break it up into ... The create procedure is used to initialize a lookup table. ...
    (alt.lang.asm)
  • Need help with GridView and LDAP/GC
    ... I could do the search with GC, and then lookup more ... DirectoryEntry searchRoot = new ... // Add search string if specified. ... // Display Name ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Color row of DBGrid
    ... S: string; ... StringGrid.Canvas.TextHeight) div 2; ... TextTop and TextLeft are only to center the text. ...
    (comp.lang.pascal.delphi.misc)
  • Re: How can I convert an 8 character Hex word to binary for a look
    ... In Excel a hex string is evaluated as a text string because it contains both ... if you have hex strings of 8 chars and only need to do a lookup based on ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Querying for value that shouldnt be in column?
    ... The hard-coded string is not in the ... >tblNotes only because a form in the app allows a user to do something ... >the field (as opposed to one of the lookup values). ... >>>string value in a query. ...
    (microsoft.public.access.formscoding)