MainForm Feeding two SubForms from Combo Selection

J

Jack

I am using Access2003.
I have a MainForm that has two subforms.
The first Subform is dependent on a selection
from a ComboBox on the Main form
The Second SubForm is dependent on the first Subform.
Everything works fine under normal cercumstances.

But when I try to use code to add a record to the
Combo Box selections, the subforms don't get
updated for the new selection in the ComboBox until
I close & reopen the form.

To add the NEW record to the combo box, I open a
small form that alows me to add a record and then
when I close that form i requery the combobox.
I've even tried requerying the subforms but that
doesn't work either.
Any ideas?
Thank you
 
M

Michel Walsh

Hi,


We may have a problem of terminology here. The combo box has a list of
items. If your list of items come from a table and you decided to add a
record to the table, and, finally, hope to see the new record you just added
to the table to be visible in the list of the combo box in a form previously
open... then, you need to requery the combo box list, with a statement like:

Me.ComboBoxNameHere.RowSource = Me.ComboBoxNameHere.RowSource


Hoping it may help,
Vanderghast, Access MVP
 

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