Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use a switch function in Access

Status
Not open for further replies.

04061975

Programmer
Mar 19, 2003
8
AU
Would someone please be able to advise me as to how and when a switch function is used in Microsoft Access? Any information would be much appreciated. Thank you in advance.
 
If you're saying a C-like switch function, the VBA/Access equivalent is the Select ... Case statement.


Look up help on "Case" or "Select" for more information.
 
The Switch function argument list consists of pairs of expressions and values. The expressions are evaluated from left to right, and the value associated with the first expression to evaluate to True is returned. If the parts aren't properly paired, a run-time error occurs. For example, if expr-1 is True, Switch
returns value-1. If expr-1 is False, but expr-2 is True, Switch returns value-2, and so on.

Switch(expr-1, value-1[, expr-2, value-2 … [, expr-n,value-n]])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top