listbox/subform update

  • Thread starter Thread starter Anne
  • Start date Start date
A

Anne

I have a listbox that allows users to pick an employee and
a subform that displays that person's info. I also have
a "Add New Employee" button, which opens the subform on
its own so that you can see the 'done' button, which
closes the form. When you go back to the original form,
the listbox shows the new employee, but picking his name
does not display his info in the subform.

Any thoughts?
 
You should have an employee table whose primary key is EmployeeID. EmployeeID
should be the first field in the rowsource of your listbox. Your subform should
be based on a query based on the Employee table and should include the
EmployeeID field. Put the following expression in the criteria of the EmployeeID
in the query that is the basis of your subform:
Forms!NameOfMainForm!NameOfListBox
 
Back
Top