Hello,
I have an unbound Employee Time Card form that Inserts many records at once. I use a combobox to display the active employees. I'm trying to create a macro that would set a true / False field to true (in Employees table) after this employees records have been added. Once the employee records have been added I would like to have this persons name removed from the combobox.
The Following code does set the True / field to true, but after requerying the combobox it does not remove name from list. If I close form then reopen the name is removed from the list.
Is there another event that is more suited for this?
Private Sub ClearcboEmployee()
Dim strCriteria As String
rstEmployees.MoveFirst
strCriteria = "EmployeeID = " & "'" & Me.cboEmployee & "'"
rstEmployees.Find strCriteria, 0, adSearchForward
If Not (rstEmployees.BOF And rstEmployees.EOF) Then
With rstEmployees
![EmployeeTemporaryInactive] = True
.Update
End With
End If
Me.cboEmployee = ""
Me.cboEmployee.Requery
End Sub
I have an unbound Employee Time Card form that Inserts many records at once. I use a combobox to display the active employees. I'm trying to create a macro that would set a true / False field to true (in Employees table) after this employees records have been added. Once the employee records have been added I would like to have this persons name removed from the combobox.
The Following code does set the True / field to true, but after requerying the combobox it does not remove name from list. If I close form then reopen the name is removed from the list.
Is there another event that is more suited for this?
Private Sub ClearcboEmployee()
Dim strCriteria As String
rstEmployees.MoveFirst
strCriteria = "EmployeeID = " & "'" & Me.cboEmployee & "'"
rstEmployees.Find strCriteria, 0, adSearchForward
If Not (rstEmployees.BOF And rstEmployees.EOF) Then
With rstEmployees
![EmployeeTemporaryInactive] = True
.Update
End With
End If
Me.cboEmployee = ""
Me.cboEmployee.Requery
End Sub