combo box filters another combo box

G

Guest

I’m having problems with one unbound combo box filtering another unbound
combo box. I’ve got the Row Source on cboContact set to filter by cboCompany.
It seems to be using the last company I select as the filter for contacts on
all records. Or... the longwinded explanation: if I choose a new company on
record 2, it erases the contacts for record 1 & refilters showing company 2's
contacts. If it's the same company, obviously it's happy & leaves it alone.

Help! Am I missing something obvious here?
sr
 
J

Jeff Boyce

If you haven't done so already, take a look at the mvps.org/access website,
or via Google.com, for "Cascading ComboBoxes". It may be that those
explanations will trigger an "aha!" for you.

Is there any chance that the field(s) underlying the comboboxes are of type
"Lookup" (instead of, say, Number, or Date/Time, or ...)?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

It sounds as if you are doing this on a continuous form. If so, that is a
problem.

A continuous form really contains just ONE set of controls that are
"replicated" in each row. With controls that are bound to a field in a
query, the control gets the value to display from that field for each row.
With controls that are not bound, the last value put into that control is
shown in all the rows.

One way to handle this involves a control bound to the appropriate field set
on top of the combobox. The display control has code in its focus event
that moves the focus to the combobox control.

If you decide to implement this solution, post back. If I can I will write
up a fuller description of the process.
 
G

Guest

Hm... well I tried it in a continuous form & it did just what you mentioned.
So I'm trying another tac... I've got a project with an architecture firm &
a contact in that firm. I change the arch on Project1 and want to sort for
contacts only in that firm. Works. Ok, then if I change to another record on
that form (it's a single form view) and change the arch, it nukes the
contacts for Project1. So it's still doing that same filtering between
records. Argh!

I'm willing to try anything - would be interesed to see what happens with
the fix you mention. Please do write. Am new to VB so please be explicit. I
cut & paste famously, though.

Thanks
sr
 
G

Guest

I've been researching & nothing comes up unless you're using a continuous
form or datasheet view, then there's red flags everywhere & some really wonky
fixes involving overlaying text boxes.

I'm using a single form & it still filters between records. I've read The
Ten Commandments of Access and have deleted all look-ups in my tables "which
art the creation of the Evil One". Check. They're straight text boxes. Still
having filtering issues.

?
 
J

Jeff Boyce

Did the "cascading combo boxes" prompt any ideas?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Prompted a lot of frustration. all the solutions offered sort the first
record beautifully. but it still carries on to mess with other records. augh.
 

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