Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Required Field

Status
Not open for further replies.

Zonie32

Technical User
Jan 13, 2004
242
US
Hi All,

I am using Access 2003. I inherited a database with about 25k records. I was asked to add a new field called BatchDate. Today I was asked to make this field a required field. I went into the Design View of the table and set the field to Required = YES.

This works fine except it gives a standard error message. how do I change the error message to my own?
 
Use the form's Error event ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim Message As String
 If DataErr = 3314 Then 
  Message = "You Message Goes Here"
  Response = MsgBox(Message, vbExclamation, "Required Field")
  Response = acDataErrContinue
 End If
End Sub


The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top