Results 1 to 3 of 3
  1. #1
    Hopeloma is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2017
    Posts
    1

    Assigning a value to combo box choices?

    Hi everyone, I am new here. I have to use Access to input data for my internship. It is not an IT internship, so knowing how to use Access wasn't a requirement. I do know some coding but I'm pretty rusty.

    My question is I am using a combo box for a couple columns. The first one consists of " ";"None - 0";"Low - 1";"Moderate - 2";"High - 3";"Extreme - 4" and the second one is " ";"None - 0";"Low - 1 (0-20%)";2;"High - 3 (40-60%)";"Very High - 4 (60-80%)";"Extreme - 5 (80-100%)". I want to be able to multiply the numbers in these together to create a new column of the product. However, as you know this calculated field doesn't work if you have anything other than a number in the drop down choice. I want to have the words such as none, low, moderate, etc. in there as well though. Is there a way to assign just a number to each choice so that when you choose the option you can see the entire string (ex. "Low - 1") but then on the back end it multiplies the number I assign to it (ex. 1) to get a final product?

    I hope this makes sense. Thank you very much in advance for your help!

    -H.W.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Are all of these three values in one combobox? Or are they separated into two? Can the calculated value be placed in a separate textbox and calculated depending on the values entered in the combobox(es)?

    Please explain exactly what you are trying to accomplish with these values, with examples.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Pretty vague.
    The first one consists of <snip>
    The first one what?? I'm going to guess you are talking about the combo boxes.

    <snip> and the second one is " ";"None - 0";"Low - 1 (0-20%)";2;"High - 3 (40-60%)";"Very High - 4 (60-80%)";"Extreme - 5 (80-100%)". I want to be able to multiply the numbers in these together to create a new column of the product.<snip>
    My Crystal Ball is in for repairs, I loaned out my Tarot cards and I can't find my I-Ching sticks. So I'm going to use WAGs. (not very scientific)



    Both of the combo boxes have a Row Type property of "Value List".

    Combo1 Row Source property will be
    0 ; "";0 ; "None - 0";1;"Low - 1";2;"Moderate - 2";3;"High - 3";4;"Extreme - 4"

    The Bound Column = 1
    Limit To List = Yes
    Column Count = 2
    Column Widths = 0


    Combo2 Row Source property will be:
    0;"";0;"None - 0";1;"Low - 1 (1-20%)";2;"Moderate - 2 (21-30%)";3;"High - 3 (41-60%)";4;"Very High - 4 (61-80%)";5;"Extreme - 5 (81-100%)"
    (I added the RED option......)

    The Bound Column = 1
    Limit To List = Yes
    Column Count = 2
    Column Widths = 0



    In a text box on the form, the Control source would be
    Code:
    =[Combo1]*[Combo2]

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

Similar Threads

  1. Avoiding blank choices in a Combo Box
    By Lou_Reed in forum Access
    Replies: 4
    Last Post: 05-09-2017, 12:11 PM
  2. Multi Column Combo Box choices set in VBA
    By RayMilhon in forum Programming
    Replies: 4
    Last Post: 05-19-2016, 10:35 AM
  3. Replies: 1
    Last Post: 04-27-2015, 10:53 AM
  4. Dynamic Combo choices for years
    By ptenhet in forum Forms
    Replies: 2
    Last Post: 02-17-2015, 06:08 PM
  5. Query to Limit Combo Box Choices
    By jimrockford in forum Queries
    Replies: 2
    Last Post: 04-23-2011, 10:24 PM

Tags for this Thread

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