Not change but possibly trap error message and deliver your own with VBA.
How are you executing the SQL? Why not prevent event causing error?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
If what you really want is a customized message then you need to trap that error number in the afterupdate event of the control. Then you'd present either a message box with your custom message, or your own form that looks like a message box.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Maybe better in the BeforeUpdate event, so you can prevent the error. Or simply set the validation rule not null in the form control?
Just to clarify - I'm pretty certain Access can't capture that error as it is returned by the ODBC driver.
Any Table level constraint must be validated in the forms before update event so that it doesn't actually trigger the table constraint.
It's one of the few downsides to setting table level constraints on SQL server.
DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
Please use the star below the post to say thanks if we have helped !
↓↓ It's down here ↓↓
In fact, in most companies the developers are briefed about existing constraints and structures on the database, and it is company policy that all restrictions are met in the front end before any commands are send to the database. If an error is returned from the database it is seen as a bug in the front end.