andy_dyer
Registered User.
- Local time
- Today, 19:37
- Joined
- Jul 2, 2003
- Messages
- 806
Hi,
I have some required fields, and trying to close the form once it has been dirtied and these fields are not complete should generate my nice error message from within my error handler...
However when i click my command button to close the form and return to the main menu I get the crazy talk Access Run Time Error Message 3317 (which you can see from my handler should be captured) where it invites me to debug etc which would scare the crap out of my users...
My command button code is simply:
However I've found that if I leave my close button enabled in the top right corner of my form window then if this is clicked it triggers my message instead and then if I try to push through it states it won't be able to save the entry...
I don't know if there is something wrong with my handler or the code on the command button but it certainly isn't doing what I want it too...
Any ideas would be gratefully received!!
I have some required fields, and trying to close the form once it has been dirtied and these fields are not complete should generate my nice error message from within my error handler...
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3314 Or DataErr = 3316 Or DataErr = 3317 Then
MsgBox "The Client Name, Project Number and Project Title are all Required - you must supply a value for these fields", vbInformation
Response = acDataErrContinue
End If
End Sub
However when i click my command button to close the form and return to the main menu I get the crazy talk Access Run Time Error Message 3317 (which you can see from my handler should be captured) where it invites me to debug etc which would scare the crap out of my users...
My command button code is simply:
Code:
Private Sub cmdReturntoMenu_Click()
Me.Refresh
DoCmd.Close
DoCmd.OpenForm "frmMainMenu"
End Sub
However I've found that if I leave my close button enabled in the top right corner of my form window then if this is clicked it triggers my message instead and then if I try to push through it states it won't be able to save the entry...
I don't know if there is something wrong with my handler or the code on the command button but it certainly isn't doing what I want it too...
Any ideas would be gratefully received!!