Adam McReynolds
Registered User.
- Local time
- Today, 02:50
- Joined
- Aug 6, 2012
- Messages
- 129
I have created a form with unbound text boxes and the user can apply prices based on DLookup of a table with prices in it. Here is the code that does that:
That works fine for standard situations. However, the issue is that the name of the Equipment such as "Line Extender" can apply the base price, but if there is a "plus major parts" then a new price needs to be entered and that data will not be in the title; only "Line Extender". So we have a table that lists these prices and I want to be able to add a combo box that pulls from these selections.
The combo box needs to narrow down the search first by querying by customer, which is [profile_types] in the table. On my form I have an unbound text box called [txt_customer1] which will hold the customer name. So I need the combo box to first take the name from this text box and narrow the query down based on this. Then I need the combo box to show the list of [repair_items] based on this customer.
Once a [repair_item] is selected from the list I need it to apply the rate which is [flat_rate_values] in the table; this needs to be applied to my unbound text box [txt_rate1].
Any help would be awesome!
Note: I have 10 rows of these unbound text boxes on my form so that is why I am not using bound text boxes.
Code:
Case "Line Extender"
strCriteria = "repair_item = 'Line Extender Repair' AND profile_types = 'Alpha'"
.txt_rate1 = DLookup("[flat_rate_values]", "tbl_module_repairs_client_item_details", strCriteria)
That works fine for standard situations. However, the issue is that the name of the Equipment such as "Line Extender" can apply the base price, but if there is a "plus major parts" then a new price needs to be entered and that data will not be in the title; only "Line Extender". So we have a table that lists these prices and I want to be able to add a combo box that pulls from these selections.
The combo box needs to narrow down the search first by querying by customer, which is [profile_types] in the table. On my form I have an unbound text box called [txt_customer1] which will hold the customer name. So I need the combo box to first take the name from this text box and narrow the query down based on this. Then I need the combo box to show the list of [repair_items] based on this customer.
Once a [repair_item] is selected from the list I need it to apply the rate which is [flat_rate_values] in the table; this needs to be applied to my unbound text box [txt_rate1].
Any help would be awesome!
Note: I have 10 rows of these unbound text boxes on my form so that is why I am not using bound text boxes.