Synchronizing a List Box

  • Thread starter Thread starter Bobbak
  • Start date Start date
B

Bobbak

Hello All,
I have developed a Form that searches and displays Employee
information, and I am having trouble with one aspect. I have a List
Box
on the form that contains the employees stats, and I would like it to
snychronize to the current Employee that is displayed in the form. I
tried to use the same method I would use to synchronize a Combo Box,
but the results I get is that the Employee stats doesn't display
unless I click in the list box. How can I have it so that once the
employee is select in the form that it will autmatically pull up the
stats in the list box for that Employee?

Here is the code I have in the form:

Private Sub EmpStatsList_AfterUpdate()
EmpStatsList = EmpID
End Sub


Thanks in advance.
 
right now your code is doing exactly what you told it to:
setting the value of EmpStatsList to equal EmpID AFTER THE
EMPSTATSLIST IS UPDATED (sorry for caps, take it as bold
or underline) - in other words, after you change the value
in the EmpStatsList control.
instead, try putting the code
EmpStatsList = EmpID
in the form's OnCurrent event.

hth
 
Back
Top