Results 1 to 3 of 3
  1. #1

    Access2K combobox (2000)

    I created a two-column combobox in MS Access 2K which read in its data from a table. The data in the table with field names Position (text) and Point (number) look like this and in this order:
    Position Point
    Scout 10
    Prefect 10
    Class monitor 8
    Member 5

    The value to be stored in the combobox variable is Point.

    When the combobox is activated, and Prefect is chosen however, Scout ends up on the screen instead of Prefect. I want Prefect to appear though it has the same Point value as Scout. Is anything amiss? Please help.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Access2K combobox (2000)

    You have two items with the same point value, Scout and Prefect. Since Scout apparently comes first in your table order, that's the way Access interprets the value. It doesn't have any way to know that you want prefect instead.

    What you should be storing is the unique value, position. That will always allow you to look up the corresponding point value by joining your other table to the table containing the position and points.

    By the way, comboboxes are controls, not usually variables unless you use an object variable to refer to the control.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 41 Times in 40 Posts

    Re: Access2K combobox (2000)

    As Charlotte noted, your combobox should be storing the Position, which enables you to get the Points associated with it when you want it. If you want to use the particular points associated with a position while working in your form, you can use the .column property of the combo box. Let's assume your control is named cboPosition. You can use cboPosition.Column(0) to refer to the Position column, and cboPosition.column(1) to refer to the Points column.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts