Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

refresh results in combo box

Posted on 2014-01-01
3
Medium Priority
?
821 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 1000 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

661 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