Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Combo Box by Closing A Form 1

Status
Not open for further replies.

tyleri

Programmer
Jan 2, 2001
173
US
I have a main form that has a drop-down combo box. If the user doesn't see the person in the list they want to select, I have a button that will open a new form where they can add the new person to the list. The problem is - after closing the New "add person" form, the combo list on the MAIN form needs to be refreshed somehow - It only works for me when I close the form and open it again. Is there a way to close the ADD form and it will refresh the combobox on the mainform??
 
Form_<main form>.<combobox>.Refresh

Forms!<main form>!<combobox>.Refresh

One of these ought to work.
 
Hi, requery the combo box on the same button that calls the form. Like this :

Private sub ButtonWhatever_Click()
docmd.openform &quot;YourForm&quot;,,,,,acdialog
ComboBox.requery
End Sub

I hope this helps.
 
access doesn't like <'s isn't the syntax ['s?

I am putting this command on the ADD form's &quot;close button&quot;.

is there a &quot;docmd.&quot; function?
 
I'm actually just using <> to say replace the name. Something like Form_main.Combo0.Requery. You may need to do Forms![main]![Combo0].Requery instead. Not sure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top