Solved

refresh results in combo box

Posted on 2014-01-01
3
791 Views
Last Modified: 2014-01-01
I have a combo box on a form with a query as it recordsource, in this case addresses.  The user requested a button on the form to add a new address that is not in the combo box.

Easy enough, I put on the button, took them to the form where they could add a new option.  The new option was added but when They return to the form the new option doesn't show in the dropdown.

How do I refresh the combo box to pick up the just added entry.

The recordsource of the combo box is a query.

I am opening the form to add an address with the acDialog option do I return to my program right after the call.

Right now I have me.addressid.requery directly after the call to the address form.

How can this be accomplished?
0
Comment
Question by:mlcktmguy
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
pdebaets earned 250 total points
ID: 39750672
You can put this after the call to open the address form in the command button, or in your form OnActivate event procedure.

MyComboboxName.requery

... where "MyComboBoxName" is the name of your combo box control.
0
 
LVL 1

Author Comment

by:mlcktmguy
ID: 39750726
That's what I'm doing and it doesn't show up.  Yet when I exit the form and come back in the new entry is in the dropdown.
Here is my code:
DoCmd.OpenForm "frmProperty_Addresses_Sub", , , , , acDialog, Nz(Me.PropertyID, 0)
Me.InterestedPartyID.Requery

Open in new window

0
 
LVL 1

Author Closing Comment

by:mlcktmguy
ID: 39750739
You get the points.  Your answer is correct.  There was some very specific code in the module to repopulate the table that  is basis for that combo box.  So even though I had the requery it didn't matter. Seeing your answer made me look further though.  Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

829 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