• Switch vs Table Lookup

    • This topic has 3 replies, 3 voices, and was last updated 16 years ago.
    Author
    Topic
    #459805

    Is Switch function popular among Access users?
    Why not using a table lookup instead?

    Armstrong

    Viewing 1 reply thread
    Author
    Replies
    • #1160330

      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.

      • #1160334

        Hans.
        Thanks for your thorough high-value input.
        Armstrong

    • #1160378

      Is Switch function popular among Access users?
      Why not using a table lookup instead?

      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.

    Viewing 1 reply thread
    Reply To: Switch vs Table Lookup

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: