Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628

    Unanswered: Combobox selection query

    I have two combo boxes on a form that are populated by two columns (ID and Detail), when the list is droped down, the list displays the ID and the detail, which is fine.

    Hwever when the user selects one of the options, it only shows the ID number. Is there any way to change this so that only the Detail is shown, but the ID is stored in memory for text boxes to acquire the neccessary data?

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Try this

    PHP Code:
      Private Sub combo_Change()
         
    Text2 combo.Column(1combo.ListIndex)
      
    End Sub 

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Text2 is your textBox
    combo is your comboBox

  4. #4
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    would you like me to attach a copy of the database as it stands at the moment? (It's an Access 97 database, so it should be compatible with any newer version.)

    I have the functionality working, it's just really for the aesthetics of the form.

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    No, problem do it

  6. #6
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    im not asking anyone to fix the problem then send the database back, it's just to clarify the situation, but anyway...

    where about will i put the code? onto the combo box directly?

  7. #7
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Quote Originally Posted by hammbakka
    Try this

    PHP Code:
      Private Sub combo_Change()
         
    Text2 combo.Column(1combo.ListIndex)
      
    End Sub 
    Yes in the On Change event or you can put it also in the on Exit event

  8. #8
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    ok, thanks. Seeing as there are 4 text boxes that are populated from this combo box, i take it i just add in a new line for each text box i.e.

    Code:
    Private Sub Combo49_Change() 
         wheel_size = Combo49.Column(1, Combo49.ListIndex) 
         ERD = Combo49.Column(1, Combo49.ListIndex) 
         OSB = Combo49.Column(1, Combo49.ListIndex) 
         ISO = Combo49.Column(1, Combo49.ListIndex) 
      End Sub

  9. #9
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    Another method that i have found to work is to hide column 1. This has the same effect.

    Thanks for your help hammbakka, i really apreciate it.

  10. #10
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Yes, you can make the width of coulmn 1 equal to 0

Posting Permissions

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