Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Switch Function Parameter
Tim Schmidt 
    
5 years ago
I am having an issue with the SWITCH function.  I get the Parameter Vale message when I run the query asking for the A, again for the B and so on.  My formula is as follows:

LETTERGRADE:SWITCH(Grade=90,A,Grade=80,B,Grade=70,C,Grade=70,F)

If I enter the letter A for the Parameter message, the letter B for the Parameter message and so on, I do get the LETTERGRADE as calculated.  Did I enter ithe SWITCH command wrong?????

Thanks,
Tim Schmidt
Richard Rost  @Reply  
          
5 years ago
Is A a field name, a variable, or some actual TEXT that you want to return? If it's text, you need to enclose it in quotes.

LETTERGRADE:SWITCH(Grade>=90,"A",Grade>=80,"B",Grade>=70,"C",Grade>=0,"F")

And I know my web site probably filtered out your > signs, but don't forget those, and F should be >=0

Richard Rost  @Reply  
          
5 years ago
Also, don't forget to see the Extended Cut of yesterday's TechHelp video: VLOOKUP in Access
Alex Hedley  @Reply  
           
5 years ago
Tim Schmidt OP  @Reply  
    
5 years ago
The letter "A" is a TEXT that I wanted.  I got this from your video.  I have used the SWITCH before with success, I do not see what I am doing wrong.
Thanks and I will check out the extended cut from the VLOOKUP
Richard Rost  @Reply  
          
5 years ago
Let me see a screen shot of what you've got in query design. I know my site eats some characters when you copy paste.
Tim Schmidt OP  @Reply  
    
5 years ago
I do not know if I did this right or not.  I hit the "PRINT SCREEN" button and a file was created in my Download directory..  Please let me know, I do not think this is what you are looking for.
Tim Schmidt OP  @Reply  
    
5 years ago

Tim Schmidt OP  @Reply  
    
5 years ago
I uploadded the correct shot, sorry for my ignorance
Alex Hedley  @Reply  
           
5 years ago
lettergrade:SWITCH([Grade]=>90, ["A"], [Grade]=>80, ["B"], [Grade]=>70, ["C"], [Grade]<=70, ["F"])
Alex Hedley  @Reply  
           
5 years ago
Did you try swapping it for the one Rich suggested where there isn't ["A"] instead is "A"
Tim Schmidt OP  @Reply  
    
5 years ago

Tim Schmidt OP  @Reply  
    
5 years ago
The first correct screen was my attempt to fix the issue, the second screen shot was without the brackets, either way I still get the same result.  I wouldn't waste any more time on this unless you are looking for something to do.
Thanks
Tim
Alex Hedley  @Reply  
           
5 years ago
Unless I'm missing something your second pic still has square brackets around the Letters
lettergrade:SWITCH([Grade]=>90, ["A"], [Grade]=>80, ["B"], [Grade]=>70, ["C"], [Grade]<=70, ["F"])

But it needs to be without
LETTERGRADE:SWITCH(Grade>=90,"A",Grade>=80,"B",Grade>=70,"C",Grade>=0,"F")
Richard Rost  @Reply  
          
5 years ago
Definitely dump the brackets.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/2/2026 6:29:42 AM. PLT: 1s