Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is Switch function popular among Access users?
    Why not using a table lookup instead?

    Armstrong

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    In general, using a table to look up values is preferable. It is more flexible, since you can easily add, remove and edit values in the table.

    The Switch function is a general VBA function that can be used in Access as well as in other Office applications, but I don't think it's used a lot - many Access developers don't even know of its existence.

  3. #3
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hans.
    Thanks for your thorough high-value input.
    Armstrong

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    [quote name='armsys' post='774968' date='13-May-2009 06:31']Is Switch function popular among Access users?
    Why not using a table lookup instead?[/quote]
    As Hans said, alot of people don't know about it. But only in a very specific circumstance is it an alternative to a table lookup. It is better used as an alternative to nested IIF statements; it is MUCH easier to read. And you might also investigate the Choose() function; another little known function.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •