Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    boundcolumn (Access 2000)

    ok. not sure if this can be done but here goes.. I have a combobox on a form called countryname. The control source for this field is a table called Countrydata_tbl. The table had 3 fields 1.countryname 2. countrycode 3. countryphonecode. I have the combo box display all 3 columns. Now what I would like to do is have 2 other textboxes on the form autofilled by what the user selects in the countryname combo box. I can do this with one box (called countrycode)easily by setting the boundcolumn property of the combo box to 2 (which is that field in the table). My question is how can I have it populate the 2nd textbox (called countryphonecode)? Is there a way to do this? Thanks...

  2. #2
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: boundcolumn (Access 2000)

    Use

    me.xTextbox.value = me.cboFirst .column(x)

    Where:
    xTextbox = the second and third textbox names
    cboFirst is the name of the combobox
    (x) = the column of the value you want pasted

    Thanks,
    Mark



    Thanks,
    Mark

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: boundcolumn (Access 2000)

    Mark has given you a solution involving VBA code - the instruction he mentions should go into the After Update event of the combo box.

    You can also use the expression he suggests in the control source of a text box:

    =[cboFirst ].[Column](x)

    where cboFirst is the name of the combo box, and x is the zero-based column number (0 = first column, 1 = second column, 2 = third column, etc.)

Posting Permissions

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