Results 1 to 3 of 3
  1. #1
    TWD is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    7

    Why is Access Complaining about This Function??

    Hey guys,



    So close to fixing my report, but alas, Access is refusing to accept my sum function statement that I am using as a control source.

    I'm trying to total all the PAB_AMOUNT figures except ones occuring on WAGE TYPE 9348 and 9349. I tested this statement in a query:

    Expr1: Sum(IIf([WAGE TYPE] Not In ("9348","9349"),[PAB_AMOUNT],0))


    However, when I plug it into the control source of a text box, Access complains and says I have Extra ) in query expression.

    That doesn't make sense because the format works on the query. What am I missing here?

    I've tried:

    =Sum(IIf([WAGE TYPE] Not In ("9348","9349"),[PAB_AMOUNT],0))

    but same error.

  2. #2
    bcofie is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Oct 2011
    Posts
    31
    tRY THIS AND SEE
    =IIf( [WAGE TYPE] Not In ("9348","9349"),Sum([PAB_AMOUNT]),0 )

  3. #3
    TWD is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    7
    I got it working finally with this:


    =Sum(IIf([WAGE TYPE] In ("9348", "9349"),[PAB_AMOUNT],0))

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Using SQL switch function MS Access
    By sandlucky in forum Queries
    Replies: 18
    Last Post: 03-31-2011, 08:49 AM
  2. Access Form If Function
    By cs93 in forum Forms
    Replies: 1
    Last Post: 03-23-2011, 02:33 PM
  3. Help with Access - IIf Function
    By cs93 in forum Programming
    Replies: 7
    Last Post: 03-19-2011, 11:52 AM
  4. Vlookup function in access
    By rici7 in forum Forms
    Replies: 1
    Last Post: 10-16-2010, 04:41 PM
  5. to_char function in Access?
    By Amber_1977 in forum Queries
    Replies: 0
    Last Post: 01-20-2009, 04:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums