ListBox Update

  • Thread starter Thread starter Chris Beardsley
  • Start date Start date
C

Chris Beardsley

I am trying to add/edit a supervisor from a subform and
have the change or addition appear in the primary form in
a listbox field. The listbox is populated from the
employees table filtered by a yes/no field supervisor.
The problem is that when a supervisors name does not
appear in the list, the user can click a button to
add/edit the employees information. When done, the user
closes the form and returns to the main form, but the new
person still does not appear. I have tried requery
without success.

Please help, second posting.

Chris Beardsley
 
Chris Beardsley said:
I am trying to add/edit a supervisor from a subform and
have the change or addition appear in the primary form in
a listbox field. The listbox is populated from the
employees table filtered by a yes/no field supervisor.
The problem is that when a supervisors name does not
appear in the list, the user can click a button to
add/edit the employees information. When done, the user
closes the form and returns to the main form, but the new
person still does not appear. I have tried requery
without success.

Please help, second posting.

Chris Beardsley

When your command button opens the form to add the supervisor, have it
open the form in dialog mode; e.g.,

DoCmd.OpenForm "frmEmployees", _
WindowMode:=acDialog

That will pause the code in the button's event procedure until the form
is closed. Then you can have a line following the DoCmd.OpenForm call,
requerying the list box; e.g.,

Me.lstSupervisors.Requery
 
Back
Top