Solved

refresh results in combo box

Posted on 2014-01-01
3
767 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

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…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

759 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

18 Experts available now in Live!

Get 1:1 Help Now