Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
303 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 1200 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 800 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

972 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