Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    233

    Unanswered: Display Relating record from Combo box

    How can I display the related record from a combo box. The combo box selects from the supplier table. There are two records Supplier_Code and Supplier_Name.

    It is the supplier code I need to insert into another table following selection. However on the form when the supplier code is selected I want to show the supplier name in a text box next to the combo box.

    The form is a continuous form and will have many records displayed. So it needs to be able to show the different selection in the detail section.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    A combobox can hold many columns.
    You reference each column with the following notation
    Code:
    Me.myComboBox.Column(0)
    Where 0 is the left-most column.

    Alternatively you can bind one of the columns as the value of the combobox. Setting the bound column to the column number that relates to supplier code will let you get the value like this
    Code:
    Me.myComboBox.Value
    Hope that makes sense
    George
    Home | Blog

  3. #3
    Join Date
    May 2003
    Location
    UK
    Posts
    233
    This works fine in as much that it brings the supplier name through. However it populates every supplier name with the same name.

    eg:
    Supp Code Supp Name
    001 ABC
    002 ABC
    003 ABC

    What it should do is only change the supplier name in the adjacent field.

    Any ideas?
    thanks

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Relate the tables together. Create a query that gives the Supplier Name along with the other table's fields. Then use the supplier name in the form.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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