I have this code in my form it works great when the user tries to change something in a field that already has a value in it. The field is numAdmitNumber. But my problem is when the go to enter a new record and the enter 123 in the numAdmitNumber then tab to the next field and they realize the numAdmitNumber should have been 321 if they go back to the numAdmitNumber field and try to change it then the message "No changes possible" displays. I do not want this message to display when they need to correct a mistake when adding a new record in this field numAdmitNumber. How can I do that?
Private Sub numAdmitNumber_GotFocus()
numAdmitNumber.Locked = Not NewRecord
End Sub
Private Sub numAdmitNumber_KeyDown(KeyCode As Integer, Shift As Integer)
If (Not IsNull(numAdmitNumber)) And (KeyCode >= 32) And numAdmitNumber.Locked = Not NewRecord Then
MsgBox "No changes possible"
End If
End Sub
Private Sub numAdmitNumber_GotFocus()
numAdmitNumber.Locked = Not NewRecord
End Sub
Private Sub numAdmitNumber_KeyDown(KeyCode As Integer, Shift As Integer)
If (Not IsNull(numAdmitNumber)) And (KeyCode >= 32) And numAdmitNumber.Locked = Not NewRecord Then
MsgBox "No changes possible"
End If
End Sub