Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autofill text box 1

Status
Not open for further replies.

math20

MIS
Jul 7, 2005
71
CA
Hi

I have 4 text boxes:


Box1 has IDs; Box2 has names; Box3 for sales, and Box4 for the dates. I would like to setup these boxes in such a way that if I type in the ID the name is automatically filled in the name text box for that id. From here these values are updated into another table.

I do have a table that holds the IDs, and the names of the staffs.
I would really appreciate if anyone can help me with this.

Thank you.
 
Replace Box1 by a ComboBox with RowSource set to something like this:
SELECT ID, Name FROM tblStaff ORDER BY 2

Then, in the AfterUpdate event procedure of that combo:
Me![Box2] = Me![Combo1].Column(1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi,

I am trying to take this process a step further. This works for one text box, now I want to autofill other text boxes. Such as Pick the name, and the ID, the mgr name and mgr ID fills in automatically.

I am following the same process where in the row source I am including:
SELECT ID, Name, mgr ID, mgr Name FROM tblStaff ORDER BY 5
Then, in the AfterUpdate event procedure of that combo:
Me![Box2] = Me![Combo1].Column(1)
Me![Box3] = Me![Combo1].Column(2)
Me![Box4] = Me![Combo1].Column(3)
Me![Box5] = Me![Combo1].Column(4)

But this only updates the first column and not the others. Can you please tell me what I am doing wrong?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top