Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29

    Unanswered: Extracting a value from the last column of a combo box

    I have a combo box with products like,

    Product Name, Description, Price per Kilo

    How would i extract the price per kilo value to another text box.

    I tried to use,

    Afterupdate
    text = ???????????????

  2. #2
    Join Date
    Jan 2004
    Location
    Vancouver, WA
    Posts
    41
    txtPrice.Value = cboProducts.Column(2)

    Or, more generically:
    txtPrice.Value = cboProducts.Column(cboProducts.ColumnCount - 1)

  3. #3
    Join Date
    Jul 2004
    Posts
    64
    text = Me.[name of combo].column(column number)

    ex: txtbox = Me.combo1.column(2)

    Remember the 1st column in a combo box is column 0

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by mtnorwood
    txtPrice.Value = cboProducts.Column(2)

    Or, more generically:
    txtPrice.Value = cboProducts.Column(cboProducts.ColumnCount - 1)
    AND if you want the "last" column OF THE ROW SELECTED you'll have to do something like:

    txtPrice.Value = cboProducts.Column(cboProducts.ColumnCount - 1,cboProducts.ListIndex)
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Jan 2004
    Location
    Vancouver, WA
    Posts
    41
    Whoops -- thanks for the correction, M Owen.

  6. #6
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29
    Cheers, Sometimes the most simplist things take the longest.

Posting Permissions

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