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

Set multiple field values based on 1 combo box 1

Status
Not open for further replies.

wbwillson

Technical User
Oct 7, 2002
52
GB
How can I set the field values for several fields using one combo box. Example, I have a table name SUPPLY ITEM which lists the Items Description, Item price, and Items Company. I use a drop down combo box to let the user select the items, this puts the Description value from the SUPPLY ITEM table into the SUPPLY MAIN Item Description for item 1. How can I also have it place the Item Price and Item Company?

TABLE Name: tblSUPPLY ITEM

Fields: ProductionDescription
CompanyName
ItemPrice

TABLE Name: tblSUPPLY MAIN

Fields to Populate based on selection above:

DescriptionItem1
Item1Price
Item1Company

Any help would be greatly appreciated.

Bill
 
HI

What you do is to change the combo box which is based on TABLE Name: tblSUPPLY ITEM to have three columns, and change the underlying query to include ProductionDescription, CompanyName, ItemPrice. If you do not want the user to see the additional items (CompanyName, ItemPrice) in the dropdown list, set the column width for these columns to 0.

Now in the After update event of the combo, you can reference these extra columns using the syntax cboName.Column(1).

Note that the Column array is zero based, so in out example above cboName.Column(1) is CompanyName, and cboName.Column(2) ItemPrice

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Ken,

Thanks...that worked like a charm! Appreciate it.

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top