Syncronizing 3 combo or list boxes

K

KevinT

Hi,

I have successfully created a sync between 2 combo boxes using the
"AfterUpdate" feature on the staff no combo box, by following info on MS site
and suggestions here.

However, I want to sync 3 boxes in total, one staff no, one Surname and a
third called FirstName.
I want it to auto insert surname & FirstName in different fields (combo
boxes) when staff no selected from drop down list.
Any suggestions very welcome & appreciated.

Thanks,

Kevin
 
D

Douglas J. Steele

I don't understand. Why do you want 3 separate combo boxes if they're all
pointing to a piece of information about the same employee? Why not have all
3 pieces of information in one combo box. Once you've selected a particular
employee, you can display the additional pieces of information in unbound
text boxes, using the Column collection in the combo box's AfterUpdate
event.

For example, if the Surname is in the 2nd column of the combo box, and the
Firstname is in the 3rd column, you'd use something like:

Private Sub MyComboBox_AfterUpdate()

Me.txtSurname = Me.MyComboBox.Column(1)
Me.txtFirstname = Me.MyComboBox.Column(2)

End Sub

(Note that the Column collection starts at 0, so that the 2nd column is
Column(1))
 
K

KevinT

Thanks Doug, I must admit to being a newbie to all this.
Your advice has helped me out.

Thanks again,

Kevin
 
Top