PDA

Click to See Complete Forum and Search --> : DB Combo - Textbox lookup


cwfern
Sep 1st, 2000, 03:14 AM
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.

Ianpbaker
Sep 1st, 2000, 03:25 AM
Are you using a data control or are you using run-time code to populate everything.

Ian

cwfern
Sep 1st, 2000, 03:48 AM
I'm using a data control.

Ianpbaker
Sep 1st, 2000, 04:04 AM
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

Ianpbaker
Sep 1st, 2000, 08:22 AM
Try putting datacontrol2.refresh

afterwards

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

Ian