# Thread: Multiple Ifs (Access 2000)

1. ## Multiple Ifs (Access 2000)

Is there a way to have an equivalent to IF .. else. For example I need to have a formula calculate using the equivalent of :
if criteria 1 is true, do calculation1; else if criteria 2 is true do calculation 2; else if criteria 3 is true do calculation 3 etc
TIA

2. ## Re: Multiple Ifs (Access 2000)

I think what you're looking for is the 'switch()' function. If you Iook it up in Access help, you get this example:

= Switch([ShipCity] = "Madrid", "Spanish", _
[ShipCity] = "Berlin", "German", _
[ShipCity] = "Torino", "Italian", _
[ShipCountry] = "France", "French", _
True, "English")

<img src=/S/king.gif border=0 alt=king width=21 height=22> eric

3. ## Re: Multiple Ifs (Access 2000)

Hi Steve,
I think you're looking for the Select Case statement. It works just the way you've described. For Example:<pre>'....
intCriteria = 3
Select Case intCriteria
Case 1
'Do Calculation1
Case 2
'Do Calculation2
Case 3
'Do Calculation 3 - since intCriter = 3, this one will be selected
Case Else
'Covers any other case (not always needed, but good to have)
End Select
'......</pre>

Check the Access Helpfile for more detailed specifics.

HTH <img src=/S/salute.gif border=0 alt=salute width=15 height=20>

4. ## Re: Multiple Ifs (Access 2000)

Thanks for quick response but I must be having a bad hair day - no refence to select case in the help file - though in all honesty I hate the new help file technique in Access 2000 and am probably using old fart searching techniques based on Access 97 <img src=/S/aussie.gif border=0 alt=aussie width=21 height=22>

5. ## Re: Multiple Ifs (Access 2000)

Oops - found it - as everyone but me probably knew , you have to be in VB to get help about it. Thanks again

6. ## Re: Multiple Ifs (Access 2000)

Steve,

I haven't met anyone yet who likes the new Help files, including the people I've talked to at Microsoft. <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15> The trick is to use the answer wizard and, as you discovered, the topics returned will depend on whether you'rein the UI or the VBE. Try framing your search string along the lines of "how do I ...." You don't have to include those words, but I've found that approach to give me the best results with the thing.

#### Posting Permissions

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