Solved

Can I update what a cbo box's row source is after it has been loaded in the form.

Posted on 2009-03-31
3
248 Views
Last Modified: 2012-05-06
Hello,

I have a cbo box on my form and it is being controlled by a qry that pulls certain items out of a table.  The user has to select one of the items from the list.  However the item may not be in the table, so I have a button that they can press and a new form opens and they can add it to the table.  When you do this, It is not able to be selected in the cbo box.  If you close the form and reopen it, it is then available.  I would like it to be available without exiting the form.  I am hoping that this is possible and fairly easy.

Thanks for your help.
0
Comment
Question by:ryanbass
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 300 total points
Comment Utility

did you requery the combo box after adding the record?


see this link
Use NotInList Event to Add a Record to Combo Box
http://support.microsoft.com/?kbid=197526
0
 
LVL 28

Assisted Solution

by:TextReport
TextReport earned 200 total points
Comment Utility
From teh command button after the form is open you can requery the combobox, however, this requery willbe ran while the form is open unless you open the form with acDialog set.

    DoCmd.OpenForm "MyForm", acNormal, , , , acDialog
    Me.cboMyCombo.Requery

Rather than using the command button you could use the NotInList event to tran when the item is not found, populate the underlying table and then get the NotInList to requery the combo.

Cheers, Andrew
0
 

Author Closing Comment

by:ryanbass
Comment Utility
Thank you both.  
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now