Storing values when using one combo box based on another?

  • Thread starter Thread starter Wolf
  • Start date Start date
W

Wolf

I tried using the combo box based on another combo box example, which I
could make work however it poses two problems for me.

1. I think the "requery" line may be responsible for changing the value in
the primary combo box in the first record to the first available selection
in that combo box. In other words the first record always defaulted to the
"1" selection on the combo list.

2. I wanted to be able to store the value in the secondary combo box, but
when I cycle through the records that value never saved and each record
would show whatever I had selected on the previos record.

Is it possible to accomplish what I want using this combo based on another
combo or should I forgo this route and try something different?
 
Wolf:

The only way a requery statement would affect your first combo box is that
it is requery-ing that combo, or the data in the combo is being based on
another set of conditions that are somehow being changed.

What you are trying to do is quite simple.
Establish Combo1
Using the AfterUpdate event, of Combo1, use the code Me.Combo2.Requery to have the data for Combo2 recalculate based on the response for Combo1.

The only obvious requirement is the SQL, behind Combo2 does actually use
Combo1 as a parameter.

As for your second issue, I would look at whatever code you are using to do
the save function. There should be some reference, in the Insert SQL
referencing Combo2.

HTH

Sharkbyte
 
Back
Top