On Error MsgBox Not Wanted
From: Andy (pchelp_at_wtcinformme.com)
Date: 07/23/04
- Next message: Allen Browne: "Re: On Error MsgBox Not Wanted"
- Previous message: Sam Kuo: "ask for password with macro"
- Next in thread: Allen Browne: "Re: On Error MsgBox Not Wanted"
- Reply: Allen Browne: "Re: On Error MsgBox Not Wanted"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Jul 2004 23:35:45 -0400
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
- Next message: Allen Browne: "Re: On Error MsgBox Not Wanted"
- Previous message: Sam Kuo: "ask for password with macro"
- Next in thread: Allen Browne: "Re: On Error MsgBox Not Wanted"
- Reply: Allen Browne: "Re: On Error MsgBox Not Wanted"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|