Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    9

    Unanswered: Combo box populating 2 text boxes automatically

    I have a tblSupplierInformation which consist of SupplierID, ContactName, PhoneNumber among other fields.

    I’m creating a combo box from the tblSupplierInformation to a form “Purchase Order Entry”. I want to create 2 text box to be populated with ContactName, PhoneNumber from that table when a supplier name is selected. How do I do that?

    Thanks,
    Kaylo

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    What I do is

    in the combo add the Feild that you want to collect

    then change the ColumnCount make that the right count

    then Change the Column Widths and the Column you don't wanr to see make them 0

    0cm;2.568cm;0cm the 1st and 3rd are hidden

    know the Code

    in the afterupdate of the combo box

    me.text = me.comboBoxName.column(1)

    will get the data from the 1st coloumn which is hidden

    me.text = me.comboBoxName.column(3)

    me.text = me.comboBoxName.column(thecoloumnnumber)

    but it can only pull the coloumn numbers base on the ColumnCount

    beats using dlookup and slowing doing the systems
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yes.

    Or you just include the fields in the underlying query of the form. When you select a record from the combo box, the fields will automatically show up if you've made the combo box bound to the foreign key.
    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

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    me.text = me.comboBoxName.column(1)
    will get the data from the 1st coloumn which is hidden


    almost.

    the column index is zero-based so .column(0) is the first column.

    izy
    currently using SS 2008R2

Posting Permissions

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