Multiple combo's, still not working

A

Adam

You may have seen my posts before but here we go again:

Ive got 13 combo's ( rig name, owner, world region, rig heading, etc.) and
one table ( MODU ) on one form ( MODU-Form ).

Still can go straight through all them, in order, having each combo filter
the combo box after it ( go from rig name to owner to world region, etc and
it will filter and return the correct results ).

I am still looking for a way to be able to go in any order through the combo
boxes, not just in order 1-13.

Currently i only have a query in each combo rowsource allowing me to go in
order, but the closest visual basic code i have seen to use in the forum
would look like this (assuming i have only the first 4 combo boxes)

Private Sub Rig_Name_AfterUpdate()
If IsNull(me.activecontrol) then
[owner].rowsource = "SELECT modu.rig_name, modu.owner, modu.world_region,
modu.rig_heading" &_
"FROM modu" &_
"WHERE modu.rig_name = '"&[forms]![modu-form]![rig name]&"' ;"
ELSE
[owner].rowsource = "SELECT modu.rig_name, modu.owner, modu.world_region,
modu.rig_heading FROM modu;"
END IF
END SUB

Thanks for any more advice, and sorry to be reposting!
 
K

Klatuu

It depends on how you want the form and the combo boxes to behave.
If you are trying to filter a combo based on other combos, it really has to
filter in one direction or you need a routine to requery all the combos based
on the current values of the combos, but even that has to be a a specific
order, depending the relationship of your data.

Are you wanting to filter the combo lists or are you just trying to use the
combos as filtering criteria for the form?
 
A

Adam

I am trying to filter the combo lists essentially. The table has 13 columns,
all different categories of offshore rigs which are what all my combos
represent. The form is needed so someone who has just the project number for
instance can go to the combo box for project number, select one, and then the
other combos will only have the proper info for that project #. So the end
result of my form is just having all the combos have information relating to
one project number.

I do realize it doesnt make much sense to others why I need a form to allow
someone to choose out of 13 boxes to narrow a search, but it is what im
trying.

Im not great with visual basic, but in plain terms it seems like i need a
code that allows every box to have all the values for it if every box is
blank. Once a box has a value selected the code would filter the other 12,
and so on. To me it seems like endless codes would have to be written for
every possible direction through the boxes, but im still hoping someone has
an ace up their sleeve to share.

Hope this helps a little, its complicated to me even.


Klatuu said:
It depends on how you want the form and the combo boxes to behave.
If you are trying to filter a combo based on other combos, it really has to
filter in one direction or you need a routine to requery all the combos based
on the current values of the combos, but even that has to be a a specific
order, depending the relationship of your data.

Are you wanting to filter the combo lists or are you just trying to use the
combos as filtering criteria for the form?
--
Dave Hargis, Microsoft Access MVP


Adam said:
You may have seen my posts before but here we go again:

Ive got 13 combo's ( rig name, owner, world region, rig heading, etc.) and
one table ( MODU ) on one form ( MODU-Form ).

Still can go straight through all them, in order, having each combo filter
the combo box after it ( go from rig name to owner to world region, etc and
it will filter and return the correct results ).

I am still looking for a way to be able to go in any order through the combo
boxes, not just in order 1-13.

Currently i only have a query in each combo rowsource allowing me to go in
order, but the closest visual basic code i have seen to use in the forum
would look like this (assuming i have only the first 4 combo boxes)

Private Sub Rig_Name_AfterUpdate()
If IsNull(me.activecontrol) then
[owner].rowsource = "SELECT modu.rig_name, modu.owner, modu.world_region,
modu.rig_heading" &_
"FROM modu" &_
"WHERE modu.rig_name = '"&[forms]![modu-form]![rig name]&"' ;"
ELSE
[owner].rowsource = "SELECT modu.rig_name, modu.owner, modu.world_region,
modu.rig_heading FROM modu;"
END IF
END SUB

Thanks for any more advice, and sorry to be reposting!
 

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