basing one combo box on another

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

Guest

I've managed to get this to work on a stand alone form but I need it as a sub
form on a main form. Whenever I add a record on the sub form (I have three
combo boxes I'm synchronizing), the first record works fine but then when I
tab to the second record (still on the sub form) the second list box is never
populated and the values disappear that I had selected in the first record
for the second and third boxes.
 
Change your cycle to current record and use .requery for your combo
boxes on the after update event of the previous combo boxes.


-doodle
 
I had already used .requery for each of the first two combo boxes and I tried
changing the cycle property for the form to current record but still have the
same result. The entries for the first record I entered in the sub form
(three combo boxes plus the related table key) are saved in the record source
but when I tab to the second record in the sub form the values in the 2nd and
3rd fields disappear from sight (the value in the first field is still
visible). I can then make a selection in the first field of the second
record (i.e. the first combo box) but then the second combo box is empty and
since the field property is set to "limit to list," it won't allow any value
to be added since there is no list. Below is the procedure in the After
Update event for the first combo box:

Private Sub SubjectsAfterUpdate()
Me.SubTopic = Null
Me.SubTopic.Requery
Me.SubTopic = Me.SubTopic.ItemData(0)
End Sub
 
I had already used .requery for each of the first two combo boxes and I tried
changing the cycle property for the form to current record but still have the
same result. The entries for the first record I enter in the sub form (three
combo boxes plus the related table key) are saved in the record source. But
when I tab to the second record in the sub form the values in the 2nd and 3rd
fields (first record) disappear from sight although still saved in the record
source (the value in the first field is still visible). I can then make a
selection in the first field of the second record (i.e. the first combo box)
but then the second combo box is empty and since the field property is set to
"limit to list," it won't allow any value to be added since there is no list.
Below is the procedure in the After Update event for the first combo box:

Private Sub SubjectsAfterUpdate()
Me.SubTopic = Null
Me.SubTopic.Requery
Me.SubTopic = Me.SubTopic.ItemData(0)
End Sub
 

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

Similar Threads


Back
Top