Requery ?

J

JK

I have a form with customer and account info based on
corresponding tables. I have a combo box displaying all
companies but if the company isn't listed, I'd like to add
a button that will open a form to enter the new company
info. No problem, but when I close the company entry form
and return to the Company/account form how can I get the
new company to show in my drop down list? Also while I'm
here, how can I sort my combobox alphabetically? Thanks
for any pointers you can provide.
 
K

Ken Snell

In the OnClose event of the form that allows the person to enter the new
entry, put this code:

Private Sub Form_Close()
[Forms]![FirstFormName]!ComboBoxName.Requery
End Sub


To sort the combo box list, use a query as the row source list and include a
sorting order on the desired field to sort that field in ascending order.
 
J

JK

Thank you very much! You all are great.
-----Original Message-----
In the OnClose event of the form that allows the person to enter the new
entry, put this code:

Private Sub Form_Close()
[Forms]![FirstFormName]!ComboBoxName.Requery
End Sub


To sort the combo box list, use a query as the row source list and include a
sorting order on the desired field to sort that field in ascending order.

--

Ken Snell
<MS ACCESS MVP>

I have a form with customer and account info based on
corresponding tables. I have a combo box displaying all
companies but if the company isn't listed, I'd like to add
a button that will open a form to enter the new company
info. No problem, but when I close the company entry form
and return to the Company/account form how can I get the
new company to show in my drop down list? Also while I'm
here, how can I sort my combobox alphabetically? Thanks
for any pointers you can provide.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top