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

Access Database Form

Status
Not open for further replies.

aprilmarie

Technical User
Apr 17, 2002
4
US
I have a combo box that is populated with numbers from a table where it is the primary key (Cost Center #'s). I was hoping that when the selection was made it would populate a text box for the cost center's name. I have been fooling around with recordsets, but I can't get it to work.

Please help,

April
 
I don't think you need recordsets for this.

Assuming your CostCenterName is in the table along with the CostCenterNumber ( # means Date to people round here ).
Make the RowSource in the combo include the two fields eg:-
"SELECT CostCenterNo, CostCenterName FROM CostCenterTable"
and the BoundColumn = 1, RowCount = 2.

Then - EITHER
1) In the combo's AfterUpdate event put
txtBox = comboName.Column(1)

OR
2) In the combo ColumnWidth put 0cm;
This will then store the CostCenterNumber in the relevant field but the combo box itself will display the list of CostCenter NAMEs for the user to pick from and display the cost center Name in the box once selected. ( Thus doing away with the need for the additional textbox.



'ope-that-'elps

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top