Solved

refresh results in combo box

Posted on 2014-01-01
3
812 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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…
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 …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

626 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