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
258 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
ID: 24030060

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
ID: 24030111
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
ID: 31564880
Thank you both.  
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run Time Error 3075 15 44
combine ShipTo and BillTo Address 3 22
Alter an update query which rounds 7 31
ms access 2013, running .mdb 2 30
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

910 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

23 Experts available now in Live!

Get 1:1 Help Now