Results 1 to 5 of 5

Thread: DB Combo - Textbox lookup

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    2
    I've seen some attempts at doing this but, have never understood fully how to do it myself successfully.

    I have a db combo that is getting its list values from the Primary key of a table. When a value is selected from the dbcombo by the user, I want its corresponding values from the two other fields in the same table to appear in two text boxes. E.G - If the user selects a user name, I want their telephone number to appear in a text box adjacent. The table in the database would be called usertel, the PK 'User' and the other record 'telnum'.

    Any help greatly appreciated


    Carl.

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Are you using a data control or are you using run-time code to populate everything.

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    2
    I'm using a data control.

  4. #4
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    In that case make another data control and bind the two text boxes to them. Then use the on_change event of the combo and have something like

    DataControl2.Recordsource = "SELECT * FROM table where id = " & combo1.Text

    That should sort out yuour problem

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  5. #5
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Try putting datacontrol2.refresh

    afterwards

    if it is't that then I don't know. I don't use data control's alot

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

Posting Permissions

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



Click Here to Expand Forum to Full Width