Link to home
Start Free TrialLog in
Avatar of H-SC
H-SCFlag for United States of America

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Data-Man
Data-Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of H-SC

ASKER

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.
what do you mean "Difference on the changes"?

Mike
Avatar of H-SC

ASKER

the changes that I make to the records on the for that opens up on click from the main form
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
Avatar of H-SC

ASKER

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
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
Avatar of stevbe
stevbe

I would use the CLose event of the editing form ...

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

Steve
Avatar of H-SC

ASKER

Data-Man,

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


Thanks Again