refer to combo box when used in continuous form

M

mcnewsxp

i am using a continuos form to display rows of data that contains two
comboboxes.
when the first in the row is clicked the seconds one's list items change.
right now when this happens all of the 2nd combo boxes contain the same
values/
what i need is for only the 2nd combo box in the associated row to cantain
the list.
how do i refer to the control at the row level?

thanks,
mcnewsxp
 
M

Marshall Barton

mcnewsxp said:
i am using a continuos form to display rows of data that contains two
comboboxes.
when the first in the row is clicked the seconds one's list items change.
right now when this happens all of the 2nd combo boxes contain the same
values/
what i need is for only the 2nd combo box in the associated row to cantain
the list.
how do i refer to the control at the row level?



You can't refer to anything other that the current record.
If the combo box is unbound, you are out of luck with this
approach.

If the combo box is bound to a field in the form's record
source table/query, then the value of the combo box is
unaffected and everything is working correctly. some of the
other rows just look messed up. This can be overcome by
using a somewhat convoluted technique involving a text box
on top of the combo box.
 
M

mcnewsxp

You can't refer to anything other that the current record.
If the combo box is unbound, you are out of luck with this
approach.

If the combo box is bound to a field in the form's record
source table/query, then the value of the combo box is
unaffected and everything is working correctly. some of the
other rows just look messed up. This can be overcome by
using a somewhat convoluted technique involving a text box
on top of the combo box.

the combobox is bound.
the chosen values remain chosen - that is all good.
it is the list of items in combobox 2 that changes each time combobox 1 is
clicked.
the users will go down the rows clicking the value for combobox 1, then go
down the rows to select the value from the list in combobox 2 expecting the
appropriate list to appear, but of course it does not.
can i check combobox 1 before showing the list in combobox 2?
 
R

Rick Brandt

[snip]
the users will go down the rows clicking the value for combobox 1, then go
down the rows to select the value from the list in combobox 2 expecting the
appropriate list to appear, but of course it does not.
can i check combobox 1 before showing the list in combobox 2?

Sure, just issue a Requery on the second one in its GotFocus event.
 
M

Marshall Barton

mcnewsxp said:
the combobox is bound.
the chosen values remain chosen - that is all good.
it is the list of items in combobox 2 that changes each time combobox 1 is
clicked.
the users will go down the rows clicking the value for combobox 1, then go
down the rows to select the value from the list in combobox 2 expecting the
appropriate list to appear, but of course it does not.
can i check combobox 1 before showing the list in combobox 2?


I prefer to use the form's Current event to Requery (or set
the Rowsource) the second combo box. At least this allows
the seconf combo to display correctly on the current record
without having to click in the first combo and then click
something else.
 
M

mcnewsxp

I prefer to use the form's Current event to Requery (or set
the Rowsource) the second combo box. At least this allows
the seconf combo to display correctly on the current record
without having to click in the first combo and then click
something else.
maybe you could explain with more detail.
are you saying use the subform's oncurrent event to requery the 2nd
combobox?
 
M

mcnewsxp

i am using a continuos form to display rows of data that contains two
maybe you could explain with more detail.
are you saying use the subform's oncurrent event to requery the 2nd
combobox?
never mind...it works!
 

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