Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2016
    Posts
    2

    combobox value

    Hi there,

    I'm a beginner and wanted a combo box to put the values in a box.

    LIST values are: YES, NO, NA



    The issue I am having is there are 18 questions 2 have 10 points and the rest have 5 points. I'd like to use a combo box and depending on the selection have that value placed in a box on the form. I don't know if I'd set this up in a table? Are there any database examples I can review?

    Thank you all so much!

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    You would have a field in your table - let's call it 'ValueX' to hold the number

    In the AfterUpdate Event of the combobox you place code to write the number value into the field ValueX.

    What the actual value should be i.e. 5 or 10 must depend on some other value in that same record - so that your AfterUpdate code is an If/then statement.

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Need more details on what you are trying to do but you can add points based on the question and the value of the combo box. In the AfterUpdate of the combo box, you could do something like:

    If Me.Combobox = "YES" then
    If Me.QuestionID = 1 Or Me.QuestionID = 2 then
    Me.QuestionPoints = 18
    Else
    Me.QuestionPoints = 5
    End If
    Else

    Me.QuestionPoints = 0
    End If

    This assumes you have a table of questions (QuestionID, QuestionText, QuestionPoints) and assumes questions 1 and 2 get the 18 points if Yes is marked.

  4. #4
    Join Date
    Dec 2016
    Posts
    2
    awesome this worked thank you!!!!

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

Similar Threads

  1. Replies: 1
    Last Post: 05-13-2015, 01:14 PM
  2. Replies: 1
    Last Post: 01-16-2015, 09:28 AM
  3. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 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