Results 1 to 3 of 3
  1. #1
    dashingirish is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    12

    Formula to assign a number to a field value?

    The field value choices are: Agree, Somewhat Agree, Somewhat disagree, Disagree



    I want to assign the following numeric values to each choice:

    1 -Agree
    2 -Somewhat Agree
    3 -Somewhat Disagree
    4 -Disagree

    I'm guessing I need to insert a column in my query and enter some kind of formula. It seems simple, but it is evading me.

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What is the value on the table - are they text, as in "Agree" etc? You may want to store them as numeric values on the table, the input on the form would be an "Option Group".

    Otherwise, you will need an IIf statement in your query :
    IIf(x="Agree",1,IIf(x="Somewhat Agree",2,IIf(x="Somewhat Disagree",3,4)))

  3. #3
    dashingirish is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    12
    Thank you for the quick response. Yes, they are text. I've never worked with an Option Group. What I'm going to ultimately need to do is group certain responses, and add the numeric values. It seems like that will be easier to do with an Option Group. Thank you for the suggestion - I wouldn't have thought of it.

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

Similar Threads

  1. Formula field
    By vidplaylist in forum Access
    Replies: 1
    Last Post: 12-07-2011, 04:37 PM
  2. Formula field
    By vidplaylist in forum Queries
    Replies: 3
    Last Post: 12-06-2011, 03:45 PM
  3. Field in query formula question
    By jcaptchaos2 in forum Access
    Replies: 7
    Last Post: 04-24-2011, 06:32 PM
  4. Replies: 1
    Last Post: 06-25-2010, 07:15 PM
  5. Assign A Sequential Number To A Table Row
    By KramerJ in forum Programming
    Replies: 11
    Last Post: 04-08-2009, 08:48 AM

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