Access - The Switch function

April 2018

The Switch function allows you to evaluate a seriesof expressions and return a Variant value corresponding value for the first expression in the list, if condition is

Switch ( expression-1, value-1, expression-2, value-2, ... expression-n, value-n )

Switch ( Customer_ID=1, "John", Customer_ID=2, "Smith", Customer_ID=3, "Thomas")
  • If Customer_ID is equal to 1, the value returned will be "John"
  • If Customer_ID is equal to 3, the value returned will be "Thomas"
Published by jak58. Latest update on January 6, 2012 at 02:51 PM by jak58.
This document, titled "Access - The Switch function," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (
Access - The CurDir function
Access - The Last function