Two combo boxes to sort independently?

F

Fatz

I have a subform that currently is populated by a list of Security
ID's in a combo box. So every time I select a Security ID from the
combo...the subform is populated with a list of all records with that
specific Security ID. (Don't worry MVPs....I have a seperate primary
key field...) Of course this isn't good enough and now they would
like to add a 2nd combo box that lists the name of the Security. The
problem is they want both and they want each combo box to work
independently from one another. So if Joe knows the ID he can sort by
that...but if Sally only knows the name she can sort by that. Is this
possible...and if so how do I go about setting it up??

(The subform runs off a query...and that query lists both the Security
ID and Security Name.)

Thanks,
Chris
 
D

Dirk Goldgar

Fatz said:
I have a subform that currently is populated by a list of Security
ID's in a combo box. So every time I select a Security ID from the
combo...the subform is populated with a list of all records with that
specific Security ID. (Don't worry MVPs....I have a seperate primary
key field...) Of course this isn't good enough and now they would
like to add a 2nd combo box that lists the name of the Security. The
problem is they want both and they want each combo box to work
independently from one another. So if Joe knows the ID he can sort by
that...but if Sally only knows the name she can sort by that. Is this
possible...and if so how do I go about setting it up??

(The subform runs off a query...and that query lists both the Security
ID and Security Name.)

Thanks,
Chris

These combo boxes are both on the main form? Am I right in thinking
that the first combo box is the Link Master Field for the subform? Are
the combo boxes unbound? If the answer is yes to all these questions,
the simplest thing is probably to let the second combo box have a hidden
column which is the Security ID, and then in that combo box's
AfterUpdate event, set the first combo box to the Security ID column
from the second combo box. You might also do the reverse in the
AfterUpdate event of the first combo box -- set the second combo box to
the corresponding item so that the two combos are in sync.
 

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