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

Beginner Help

Status
Not open for further replies.

Demus

Programmer
Aug 20, 2002
5
CA
I'm extreemly new to Access programming. I've done lots of programming work in the past and I'm just trying to figure out how things all fit together in Access.

Can anyone recommend any good books or web sites that might be of us? I have no previous SQL experience.

Anyway, here's my question. I have a form setup to list employee names in a combo box. The employee names are pulled from a table called employees. The form is actually using a different table as its record source. I would like to pull a value from the employee table, from the same record the employee name selected in the combo box belongs to and put that value in a field on my form.

My problem is that I haven't the faintest clue as how I could get that value from the employee table. The rest I know how to do.

Thanks,
Demus
 
Demus,
Actually very easy to do. Suggest the following approach:

(a) Get your dropdown combo working the way you want; ie. displaying the data from the employee table (do this via the RowSourceType and RowSource properties of the combo control.

(b) Then simply set the ControlSource property of the combo control to link back to the field in the underlying table.

Essentially what happens then is that the combo value you select, is written back to the forms underlying recordsource, to the 'controlsource' field you nominated. More specifically, if the combo list is presenting more than one column per row (which you control via the combo's query, and the columncount and the columnWidths properties), then you can control which of the combo's columns is written back to the form's table via the use of the BoundColumn property (which defaults to 1; ie. the first column).

Hope this helps,

Cheers
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
Try the Combo box wizard. Read the options available at each step and it will do it all for you.

First step, select the table that the combo box gets it data from, then which fields. Next ajust the width. Next tell it which field to store the data in and all the hard work will be taken care of

Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top