topdesk123
Programmer
Good morning!
In the Time Card form, users can choose an employee from a drop down box and enter theri time card details. I have the following code setup in case a user accidentally begins to overwrite an exiting record:
Private Sub EmployeeID_Change()
On Error GoTo EmployeeID_Change_Err
If Not IsNull(Me![EmployeeID]) Then
MsgBox "YOU ARE ABOUT TO CHANGE AN EXISTING RECORD!", vbOKCancel
Me.Undo
End If
EmployeeID_Change_Exit:
Exit Sub
EmployeeID_Change_Err:
MsgBox Err.Description
Resume EmployeeID_Change_Exit
End Sub
The problem is, when adding a NEW record using the mouse to choose the employee from the drop down, the error message pops up and the record can't be added. It doesn't however, pop up when you enter the employee using the keyboard. Anyone have any ideas?
TIA
topdesk
In the Time Card form, users can choose an employee from a drop down box and enter theri time card details. I have the following code setup in case a user accidentally begins to overwrite an exiting record:
Private Sub EmployeeID_Change()
On Error GoTo EmployeeID_Change_Err
If Not IsNull(Me![EmployeeID]) Then
MsgBox "YOU ARE ABOUT TO CHANGE AN EXISTING RECORD!", vbOKCancel
Me.Undo
End If
EmployeeID_Change_Exit:
Exit Sub
EmployeeID_Change_Err:
MsgBox Err.Description
Resume EmployeeID_Change_Exit
End Sub
The problem is, when adding a NEW record using the mouse to choose the employee from the drop down, the error message pops up and the record can't be added. It doesn't however, pop up when you enter the employee using the keyboard. Anyone have any ideas?
TIA
topdesk