Combo Box Look Up

G

Guest

I looked threw some of the other combo boxes look up topics and maybe I am
just going about this in the wrong way.

I have a form with a link to a subform, in the subform I have combo boxes
for selected entry. I want the selection in the first combo box to limit the
next combo box in the chain. I have tried useing a SQL on the combo box, and
the result I am getting is that the selection in the first combo box is
applied to all the entries in the subform (the other progressive entry lines
in the data sheet). Is this jsut a problem with the datasheet subform (as in
I am not useing it in a way I should). Or can I correct this in some way?
 
A

Al Campagna

wizard,
On my website below, I have a sample V97 and V2003 file called Synched Combos. It
demonstrates the meothod to do that.
Basically, you use the selected value from combo1 to filter the query behind combo2.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
G

Guest

In the world of MS Access you are referring to a "cascading combo".

I suggest the following:

1) If the source for the first combo is a single field table then you can
use the table as the source (otherwise when you select a multi field table
invoke the query builder and select a single field).

2) Create a new query that contains the field for the first column and the
column for the second combo. Eg If you want to select "Col B" based on "Col
A", select the visible checkbox for "col B" and make it the first column, in
the criteria box for "ColA" you want something like
[forms]![FORMNAME]![FIELDNAME] and make "ColA" invisible.

Use this query as the source for the second combo box. Depending on whether
your combos are in the main form or the subform, your criteria will obviously
change.
 
G

Guest

forgot to mention.

me.FIELDNAME.requery

in the "after update" event in the first combo.
 

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