Requery ?

  • Thread starter Thread starter JK
  • Start date Start date
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.
 
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.
 
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.


.
 
Back
Top