+ Reply to Thread
Results 1 to 3 of 3

Access Expression Error

  1. #1
    Registered User
    Join Date
    07-20-2012
    Location
    Ottawa Canada
    MS-Off Ver
    Excel 2003
    Posts
    20

    Access Expression Error

    Good Morning,

    I have a Union database in which I have grouped my Local Officers by their Local number, then I want to have them sorted by position. I have written an expression, but I'm getting an error (Syntax error (comma) in query expression) but I can't find the error!

    I want them to be listed 1. president, 2 acting president...etc...(as seen below)

    The Query is for the "Upload" table, and the information is to be sorted by "Union Position Standard Name".

    Can anybody see the error of my ways?

    "Expr1: IIf([Union Position Standard Name]="President",1,IIf([Union Position Standard Name]="Acting President",2,IIf([Union Position Standard Name]="Vice-President",3,IIf([Union Position Standard Name]="1st Vice-President",4,IIf([Union Position Standard Name]="2nd Vice-President",5,IIf([Union Position Standard Name]="3rd Vice-President",6,IIf([Union Position Standard Name]="Secretary",7,IIf([Union Position Standard Name]="Treasurer",8,IIf([Union Position Standard Name]="Secretary / Treasurer",9,IIf([Union Position Standard Name]="Chief Steward",10,IIf([Union Position Standard Name]="Shop Steward",11,IIf([Union Position Standard Name]="Misc Contact",12,IIf([Union Position Standard Name]="Health & Safety",13,IIf([Union Position Standard Name]="Communication Officer",14))))))))))))))"

    Jennifer

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Access Expression Error

    Well at first glance the problem might be that you don't have a value for the very last IIf statement when false... this will work, but returns 0 on no match, you may want to change it to the desired outcome for "none of the above" scenario.

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Access Expression Error

    Jennifer, any luck?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Compile error: Constant expression required error when merging two Codes
    By Kezwick in forum Outlook Programming / VBA / Macros
    Replies: 8
    Last Post: 06-26-2013, 09:32 AM
  2. Need help trying to create Sumif expression in Access
    By delpiero5464 in forum Access Tables & Databases
    Replies: 1
    Last Post: 05-22-2013, 03:12 PM
  3. [SOLVED] Compile Error: Expected Expression, Syntax Error
    By gjohn282 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2012, 11:28 PM
  4. Expression for Sequential Numbering in An Access Query
    By mcranda in forum Access Tables & Databases
    Replies: 1
    Last Post: 07-05-2012, 06:11 PM
  5. VBA compilation error : expected expression error
    By raknahs in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-21-2010, 12:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1