Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

Refresh Dropdown

I have a form that has a common dropdown .  Next to the dropdown I have a button that opens another form that has the values for the dropdown.  I would like for the user to be able to click on the button and modify the values and close the form and the new values show up on the dropdown.  Keep in mind that I am using the same form that these values are stored in on other forms.  so the requery dropdown has to be universal to other forms.  I hope that this makes some sense.

Thanks
0
H-SC
Asked:
H-SC
  • 4
  • 4
1 Solution
 
Data-ManCommented:
In the activate event of the form with the combo box put this code

Me.cboComboBoxName.Requery


When ever this form receives the focus it will requery the combo box

Mike
0
 
H-SCAuthor Commented:
Mike,

Thanks for the response.  I tried Me.cboComboBoxName.Requery
and does not give me errors but also does not make any difference on the changes.
0
 
Data-ManCommented:
what do you mean "Difference on the changes"?

Mike
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
H-SCAuthor Commented:
the changes that I make to the records on the for that opens up on click from the main form
0
 
Data-ManCommented:
If the form that opens is based on the same table that the combo box is using they can't be different.

Let's make sure that we are on the same sheet of music.

You have a combo box on a form.  You click a button that opens a form and displays all the items in the combo box..so they can be edited correct?  

When you close the form, the combo box show's the changes made via the form correct?

Where is the problem?

Mike
0
 
H-SCAuthor Commented:
This is the problem .....When you close the form, the combo box show's the changes made via the form

It does not show those changes
0
 
Data-ManCommented:
In the Activate event for the form with the combo box do this

Me.cboComboBoxName.Requery

If there are records in the underlying table added via the other form, this line of code will cause them to show up.

Sorry I sound like a broken record, but that is what the Requery does...gets the new records.

Mike
0
 
stevbeCommented:
I would use the CLose event of the editing form ...

Private Sub Form_Close()
   Forms("MyForm").Controls("MyComboControl").Requery
End Sub

Steve
0
 
H-SCAuthor Commented:
Data-Man,

I must have been doing something wrong.  Your suggestion .....  Me.cboComboBoxName.Requery worked great !!!


Thanks Again
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now