populate textbox after MULTIPLE combobox selection

PvL

New member
Local time
Today, 09:21
Joined
Jul 4, 2008
Messages
6
Hi guys (and gals)

Got a bit stuck in a database.
I have a form based on a query
On the form I have 4 comboboxes.
The combo boxes filter eachother without a problem (based on custom select query)

Now I want after the fourth combobox value is selected, I want to populate a text field with a value from a different column from the master query (after the 4 selections only 1 value should be possible)

I try to say this easy.
Master query contains 5 columns:
- group
- type
- job
- insurance
- charge

combo1 selects group (and filters records)
combo2 selects type (from remaining records and filters again)
combo3 selects job (from remaining records and filters again)
combo4 selects insurance (from remaining records and filters again)

Combo4 is based on following query:
-column1
Insurance
Total=Group by
Show=yes
-column2
Job
Total=Where
show=no
Criteria [forms]![name].[combo]

This works great and the dropbox only shows 1 OF EACH DIFFERENT record

If I add a text box and want to see the "charge" value, that I thought I could use the ME.text-code. But in order to do this, I have to add the charge column into the query of Combo4.
If I do this, the dropbox for insurance gives me multiple values that are the same. Is there any way to make this work?

Hope someone can help!
Thanks in advance!
 
You could use DLookup in the Control Source of the text box to find the value you want based on what is selected in Combo 4. Example;

=DLookup("Charge", "tblYourTable","SomeValue=" & [Combo4])

Depending on the data types you're dealing with, you may need delimiters in the criteria of the DLookup. Also, one caveat, if this is a continuous form this won't work (at least not as you would want it to).
 

Users who are viewing this thread

Back
Top Bottom