the form is unbound
the purpose is to add new employees to "tblEmpDetails"
and when an existing employee is selected other combo boxes (previously unmentioned) from cboSearchName
are populated where they can be changed then when the "edit Button" is pressed the data is updated in the table.
currently to set an employee to Active "False" i have it as an "on Click" in vba on a button.
I want to control from the checkbox rather than a button.
here is the current VBA i am using for the Remove Button "ON Click" (remove button simply sets the Active Field to "False")
could I use a similar thing on the checkbox?
Code:
Private Sub cmdRemove_Click()
If Not (Me.listEmpDetails.Recordset.EOF And Me.listEmpDetails.Recordset.BOF) Then
If MsgBox("Are You Sure You Want Set This Person to Inactive?", vbYesNo) = vbYes Then
CurrentDb.Execute "UPDATE tblEmpDetails " & _
"SET Active=False " & _
"WHERE EmpID='" & Me.cboSearchName.Column(0) & "'"
'refresh list
Me.listEmpDetails.Requery
'Clear Form
cmdClear_Click
End If
End If
End Sub