A
Andy
Hi;
When a user types in a required field, and then deletes the characters, and
tries to move to a different record the user gets the internal warning box:
"Index or Primary key cannot be blank".
Created a simple procedure that works:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Response = acDataErrContinue
DoCmd.DoMenuItem acFormBar, acEdit, acUndo
End Sub
Realized that this is helpful for many Forms.
Want to create one Function instead of multiple Private Subs.
Public Function CantBeBlank()
Dim DataErr As Integer
Dim Response As Integer
Response = acDataErrContinue
DoCmd.DoMenuItem acFormBar, acEdit, acUndo
End Function
It called correctly =CantBeBlank()
But the internal warning box appears.
Added: DoCmd.SetWarnings False
Not working.
Any Suggestions?
Andy
When a user types in a required field, and then deletes the characters, and
tries to move to a different record the user gets the internal warning box:
"Index or Primary key cannot be blank".
Created a simple procedure that works:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Response = acDataErrContinue
DoCmd.DoMenuItem acFormBar, acEdit, acUndo
End Sub
Realized that this is helpful for many Forms.
Want to create one Function instead of multiple Private Subs.
Public Function CantBeBlank()
Dim DataErr As Integer
Dim Response As Integer
Response = acDataErrContinue
DoCmd.DoMenuItem acFormBar, acEdit, acUndo
End Function
It called correctly =CantBeBlank()
But the internal warning box appears.
Added: DoCmd.SetWarnings False
Not working.
Any Suggestions?
Andy