Change Image Either Way with button & Combobox on form

mba_110

Registered User.
Local time
Today, 13:45
Joined
Jan 20, 2015
Messages
280
Hi everyone,

I have a frmEmployees with subform of same table without linking child and master field, just to show the list this form is used to input data in DB, i have fields from tblEmployees cboEmpID and their are two buttons on the form for next and previous record.

I have code for cboEmpID selection when i select it imageholder which is unbound object frame show the employee picture but when i move it with button for next and previous it doesnt appear i want it should work in both ways, when i select it from cboEmpID and also if i use next and previous button image should appear.

my code is
Code:
Private Sub cboEmpID_AfterUpdate()
Imageholder.Picture = Nz(DLookup("[picture]", "tblEmployees", "[EmpID]='" & Me.cboEmpID.Value & "'"), "")

End Sub

And imageholder should not show image if cboEmpID selection/Value is changed or blank.

thanks for helping.
 

Users who are viewing this thread

Back
Top Bottom