Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2008
    Posts
    2

    Unanswered: Link between textbox and combo box

    Hi all,
    I'm using Access 2000 to make an application. There is a form with a combo box and a text box. Combo box shows UserID and text box shows UserName of User table. My idea is when I change UserID combo box, text box will change automatically. How can I do? Please help me.

    NMD

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    A control source of

    =ComboName.Column(1)

    should keep the textbox displaying the correct name.
    Paul

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    or place soem code behind the relevant event(s) for the combo box, if you have already set the control source assuming you are using bound controls

    choosing the appropriate event can often be a bit of a problem, especially for combo/list boxes.

    on click.. certainly.. where the users has selected a row from the list box
    on change... maybe(but I don't think its appropriate for you
    on lost focus.. maybe

    you may need to do a "bit of both", note that changes have been made in the on change event, and then handle those changes in the on lost focus event. You wouldn't want to reassign the value if the user merely temporarily visited the combo box, and left.. that would happen if the were just visiting. you only want to assign the value when its changed.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I'd use the after update event, which should fire any time the data is changed. I didn't recommend that route because normally the name wouldn't be stored in the second table, just the ID.
    Paul

  5. #5
    Join Date
    Jan 2008
    Posts
    2
    Thanks all,
    I tried as Pbaldy and it's OK

    NMD.VN

Posting Permissions

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