I have a form for staff details, the details come from Access and i am using this piece of code for my List box:
what i wana do is add a picture box to my form. So when I click on a different name or the StaffId in the listbox, that staffs picture should show up.
Can you please tell me how to do this and what i will need to do on Access to enable this to happen.
Code:
Private Sub lstRecord_Click() rsMyRS.FindFirst " StaffID =" & Str(Split(lstRecord.List(lstRecord.ListIndex), vbTab)(1)) txtStaffid.Text = rsMyRS!StaffID txtFname.Text = rsMyRS!Firstname txtSname.Text = rsMyRS!Lastname txtDate.Text = rsMyRS!Date txtDob.Text = rsMyRS!DOB txtAddress.Text = rsMyRS!Address txtCtown.Text = rsMyRS!City_Town txtPcode.Text = rsMyRS!Postcode txtTel.Text = rsMyRS!Tel txtMob.Text = rsMyRS!Mobile txtEmail.Text = rsMyRS!Email txtPreocc.Text = rsMyRS!Preocc txtNote.Text = rsMyRS!Note optTemp.Value = rsMyRS!Temporary optPermin.Value = rsMyRS!Permanent End Sub
Can you please tell me how to do this and what i will need to do on Access to enable this to happen.
Comment