Double Combo Boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a continuous form with two combo boxes, the second comb box list is
dependent on what is selected in the first one. The second one does populate
correctly - but all the rows change depending on the selection made rather
than just the row that I'm entering date into! Need some guidance on this.
Using Access2003 - code below from 2nd combo box which I'm assuming - maybe
incorrectly - is the problem. Thanks! Jani

Private Sub AgitationType_AfterUpdate()
Dim cnn As ADODB.Connection
Dim rsSnap As New ADODB.Recordset

Set cnn = CurrentProject.Connection

' Open Snapshot type
rsSnap.Open "dbo_uAgitationByVess", cnn, adOpenStatic

rsSnap.Find "AgitationType = '" & Me!AgitationType & "'"

Me!MixingVesselType = rsSnap!MixingVesselType
AgitationType.Requery

rsSnap.Close
End Sub
 
I have a continuous form with two combo boxes, the second comb box list is
dependent on what is selected in the first one. The second one does populate
correctly - but all the rows change depending on the selection made rather
than just the row that I'm entering date into!

The problem is that on a continuous Form, there is really only *one*
combo box - displayed many times. If you change its properties (its
RowSource in this case), all rows reflect that change.

One somewhat snarky but effective getaround is to put a Textbox onto
the form, carefully superimposed over the text area of the combo box
(don't cover the dropdown tool though). Set its COntrol Source to
either a DLookUp expression looking up the current record's value from
the lookup table, or (if practical) base the Form on a query joined to
the lookup table and simply make it a bound textbox.

Set the textbox's Enabled = No, Locked = Yes, Tab Stop = No so the
user can't do anything with it; it's for display only. You may need to
move it in front of the combo box (with Move To Front on the Format
menu).

When the user selects the dropdown, the combo box data will come in
front and allow (filtered) selection; when it's not selected, the user
will see the textbox.

John W. Vinson[MVP]
 
Thanks, John, for the quick reply. I believe the issue was that I hadn't
bound the combo boxes. When I made that change, I'm got back on track. Jani
 

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

Back
Top