467,074 Members | 1,092 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,074 developers. It's quick & easy.

How to Requery combobox in subform based on unbound parent form listbox

I have a combobox on a subform that is based on an SQL that uses a listbox on the unbound parent form as the criteria. When the form is first loaded, it works perfectly, limiting the dropdowns to only those associated with the listbox. However, when I update the listbox, I cannot get the combobox to requery. I've tried requery AfterUpdate on the listbox control, AfterUpdate on several subform controls, as well as trying to requery the combobox on several other events.

Any suggestions?

May 13 '10 #1
  • viewed: 5657
5 Replies
Jerry Maiapu
Try to requery the sub form using its on current event. If not try on parent form's on crrent event..

Just a suggest..
May 14 '10 #2
when you open your mainform and change the data in the listbox
the combobox should have the same sql statement
and could be updated using
Expand|Select|Wrap|Line Numbers
  1.  private sub combo_box after_update()
  2. me.combo_box.requery
  3. end sub
if you found the combobox un-updated in this case just select any other item within the combobox then redrop down combobox you will find the combobox updated
hope this helps
May 14 '10 #3
Expert Mod 16PB
In the AfterUpdate event procedure for the ListBox on the main form add a call to .Requery the ComboBox on the subform. As you leave no name details I can only point you at Referring to Items on a Sub-Form for instructions on how to formulate the reference correctly.

Welcome to Bytes!
May 14 '10 #4
Thanks everyone. The On Current on the subform worked great. I had previously tried the afterupdate on the listbox on the mainform but I couldn't get it to work.
May 14 '10 #5
Jerry Maiapu
Welcome to bytes
May 18 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by F. Michael Miller | last post: by
5 posts views Thread by ApexData@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.