filter a Combobox value with a button

G

Guest

I have a value in a text box that is built on three choices in three combo
boxes
combobox1.value + combobox2.value + combobox3.value built on "AfterUpdate"
It works nicely, now the employees would like to enter the value in the
text box and have it work backwards to populate the comboboxes.
I've been playing with this, but it seems to set the first one, but the
other ones are left blank. Is there an easier way?
Any help is greatly appreciated.
(The combo boxes are kept notvisible if not needed, and this code is run
from a button on click after a value is entered into "Section")

Me!Ofunction.Visible = 1
Me!Ofunction = DLookup("Functionno", "Function",
"Function.FunctionNo=Left([Forms]![OrdersUnbound]![Section],2)")
Me!County.Visible = 1
Me!County = DLookup("County", "County",
"County.CountyNum=Mid([Forms]![OrdersUnbound]![Section],3,2)")
Me!EntityType.Visible = 1
Me!EntityType = DLookup("EntityType", "LocalEntity",
"LocalEntity.EntityNum = Right([Forms]![OrdersUnbound]![Section],2) AND
LocalEntity.County=Mid([Forms]![OrdersUnbound]![Section],3,2)")
 
G

Guest

I'm a dumbA__, my code does work, the combo boxes are multiple column and I
was pulling the value for the wrong column.
Sorry for wasting anyones time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top