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
281 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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 …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

735 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