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

How to find value from user selection

Status
Not open for further replies.

domoputro

IS-IT--Management
Apr 2, 2003
7
US
I have 2 combo boxes, cboJobTitle and cboJobLevel, which come from 2 seperate table.

Then, I have an unbound textbox, txtWage. I want txtWage to have value from the combination selection of job title and job level.

I have Wage table which has salary of all job title and level.

For example, if System Analyst and Level 2 is selected in the combo boxes. The value in txtWage should be the salary of System Analyst Level 2 in the Wage table.

Can anyone help?
 
You'll have to do the equivalent of running a query every time one of the comboboxes change. This is generally frowned upon, as it does a lot of unnecessary network traffic. But, do the following:

1. Set the textbox's Control Source to:

=DLookup("fieldname","query_or_table_name","criteria based on cboBoxes")



You can either

1. Build a query that pulls the values from the comboboxes directly, then use DLookup("field_in_query","queryname")

2. Use DLookup with the Domain set properly, i.e. DLookup("Salary_field_name","Wage","something about title = " & cboEtc)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top