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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill in Text Box based on Selection Picked in Combo Box

Status
Not open for further replies.

DiTab1

Technical User
Feb 9, 2005
5
US
Please help...

I am trying to write the code to make my text box auto fill with data based on the selection clicked on in a combo box in the same form.

Info:
Form Name: Main
ComboBox Name: Caller (Pulls from Table Caller w/three fields CID (Autonumber Pri Key), Caller (Text), SupName (Text))
TextBox Name: Supervisor

I would like to have the code so that if someone clicks on a name in the Caller combo box (example: 1 John Doe Jane K)
then Jane K will auto fill in the text box. The only thing the user can actually see in the combo box is John Doe. The other 2 fields are hidden.

Thanks for any assistance.

Di
 
In the AfterUpdate event procedure of the combo:
Me![Supervisor] = Me![Caller].Column(2)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
OK, shoot me now...

I tried entering the code provided. Everytime I click on an option in the combobox now it says Microsoft access can't find the macro "Insert code here"

I am using Access 2002, not sure if that makes a difference.

Thanks!
 
In the property sheet of the combo, be sure the value of on after update is set to <event procedure>, click the ellipsis (...) on the right, paste the code in the procedure body.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top