Filtering Combo Box from another form

P

Pam

I'm opening Form2 from Form1. A combo box in form2 is filtered based on data
available in Form1.

In the Open event (I also tried the Load event) on Form2 I value a string
with the approp SQL, set the rowsource on the combo box and requery the combo
box.

The code works just fine when there are records already in the data source
for Form2 - but when it is empty it doesn't work and I get nothing in the
rowsource for the combo box. When I watch the code run I see that it executes
and that the sql and resource are values properly.


Any ideas? Always, thanks in advance.
 
A

Armen Stein

I'm opening Form2 from Form1. A combo box in form2 is filtered based on data
available in Form1.

In the Open event (I also tried the Load event) on Form2 I value a string
with the approp SQL, set the rowsource on the combo box and requery the combo
box.

The code works just fine when there are records already in the data source
for Form2 - but when it is empty it doesn't work and I get nothing in the
rowsource for the combo box. When I watch the code run I see that it executes
and that the sql and resource are values properly.


Any ideas? Always, thanks in advance.

There's an bug in all recent versions of Access that makes the value of
an unbound combobox in a form's header "disappear" if there are no
records in the recordset. This *might* be that bug.

If you click into the empty combobox, do you notice that the insertion
point behaves as though there is invisible text (white on white) in
there?

In Form2's On Load event, try a requery of the combobox (just the
combobox, not the whole form). We use this as a workaround for a
similar situation.

BTW, this issue seems to be resolved in Access 2007 Beta 2. Hopefully
it stays that way!
 
P

Pam

You know what? - as happens too many times, going back and checking and
rechecking my facts caused me to see what I should have checked from the
beginning.

I was focused on the difference between records in the form source and not -
when all the while it was actually the different data that caused the
difference. I had a flaw in the data structure, that drove a flaw in the
data...

In any case, thanks for trying.
 

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