Results 1 to 2 of 2

Thread: combo box issue

  1. #1
    Join Date
    Jan 2014
    Posts
    1

    Unanswered: combo box issue

    I have two tables called Maintbl and Perstbl. The MAINtbl contains biographical information on clients and the Perstbl has fields such as mood, affect, appearance and so on. The fields contain items to be used in a combo box (i.e. field mood contains sad, euthymic, angry etc..) I have a form called Mainfrm that I use to input data into the maintbl. On the form I have my combo box and I can scroll through one of the fields in the Perstbl and see the text sad, euthymic, etc... However, when it writes to my Maintbl it places a numeric value in the designated field rather than the text. The numerical value relates to some value that each item in a field has. I need the combo box to put the text that I see in the combo box into my maintbl instead of the numeric value. I built the combo box using the combo box wizard that opens in access 2013. - It "seemed" so simple - I am lost and any help would be most appreciated.

    thanks in advance

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    In such a case, the combo should have 2 columns: the first (which can be invisible) with the numeric value associated to each mood, and the second containing the descriptions of the moods (sad, euthymic, angry etc..).

    You use the AfterUpdate event of the combo to run a procedure that will handle a change of selection in the combo. In such a procedure, you can retrieve the values in the columns of the combo using the following syntax:
    Code:
    <Value in the first (leftmost) column> = Me.ComboName.Column(0)
    <Value in the second column> = Me.ComboName.Column(1)
    ' etc...
    Have a nice day!

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
  •