Results 1 to 4 of 4
  1. #1
    CherylS is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    1

    Psych Testing


    I am creating a psychology testing/reporting database and am having a small problem with one of the tests. This particular one if the individual answers the question with a one it is awarded 100 pts, 2=75, 3=50, 4=25 and 5=0. I have been trying to select the field as a calculated field and using the following expression:

    IIf([sf36Q1]="1", 100,IIf([sf36Q1]="2", 75,IIf([sf36Q1]=31", 50,IIf([sf36Q1]="4", 25,IIf([sf36Q1]="5", 0)))))

    Not having much luck with this one, any advise for a beginner?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Perhaps:
    = IIf([sf36Q1]="1", 100,IIf([sf36Q1]="2", 75,IIf([sf36Q1]="3", 50,IIf([sf36Q1]="4", 25,IIf([sf36Q1]="5", 0)))))
    Or:
    = IIf([sf36Q1]=1, 100,IIf([sf36Q1]=2, 75,IIf([sf36Q1]=3, 50,IIf([sf36Q1]=4, 25,IIf([sf36Q1]=5, 0)))))
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    IIf([sf36Q1]=1, 100,IIf([sf36Q1]=2, 75,IIf([sf36Q1]=3, 50,IIf([sf36Q1]=4, 25, 0))))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Is sf36Q1 a number or text type field?

    The expression shows 31" instead of "3".

    If number field, try:

    Nz(Choose(Nz([sf36q1],0), 100, 75, 50, 25, 5), 0)


    Otherwise:

    Nz(Choose(Val(Nz([sf36q1],0)), 100, 75, 50, 25, 5), 0)

    or

    Nz(Switch([sf36q1]="1",100, [sf36q1]="2",75, [sf36q1]="3",50, [sf36q1]="4",25, [sf36q1]="5",5), 0)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Testing
    By alansidman in forum General Chat
    Replies: 5
    Last Post: 10-24-2013, 03:58 PM
  2. Testing Scores
    By helpaccess in forum Queries
    Replies: 4
    Last Post: 08-22-2011, 09:08 AM
  3. Testing Recordset for Records
    By AccessGeek in forum Programming
    Replies: 5
    Last Post: 03-22-2011, 12:26 PM
  4. Testing Task - Forms
    By collwill in forum Access
    Replies: 1
    Last Post: 03-09-2011, 10:25 PM
  5. Testing links
    By piflechien73 in forum Forms
    Replies: 0
    Last Post: 06-01-2009, 05:09 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