Default error messages

brothertse2008

Registered User.
Local time
Today, 14:38
Joined
Mar 6, 2009
Messages
29
I have a form for which to submit an item. On filling partially filling in the form and selecting the "back" button it throws up the error message.

i want it to say somethingmore helpfull to the user. i tried to use the "on error function" with no luck. a macro is in use for this cmd button also
 
By "back" is you mean the previous record, then I would use the form's Before Update event to do the data validation. This will allow you to provide whatever error message you want and also Cancel the navigation.
 
no i mean i have a command button named "back" to take me from a form which the user would be filling in. the user changes his mind and clicks "back" to return to the previous form. when clicking back access gives errror msg.
 
It probably would help if we knew what error message you're receiving! Does it perhaps reference required fields that have been left empty?
 
just says it cant save the record at this time because the field cant be left null but do i want to close anyway. i dont want to change it so it can be null otherwise when entering data, things wil get missed. isnt there a place i can look to modify these messages
 
Okay, so at least one field is set as 'Required.' The error is # 3314, so use this code

Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
 
Dim Message As String

If DataErr = 3314 Then 'Required field is empty
  Message = "You Have Left The Field  “ & Me.ActiveControl.Name & “ Empty and It Must Have Data!”
  Response = MsgBox(Message, vbExclamation, "Data Required For This Field")
  Response = acDataErrContinue
End If
End Sub
It'll pop up a messagebox telling the user that a required field has been left empty and tell them which field it is.
 

Users who are viewing this thread

Back
Top Bottom