If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Overriding constraint violation message
Hi
I'm at my first try to use SQL Server as back-end database for Access front-end. On SQL Server, I created constraints (additionally to primary key) for my tables: a) foreign key constraints to control data integrity (deleting entries linked to other tables isn't allowed); b) check constraints (certain fields or combination of fields must be unique). It works all fine in access, but when those constraints are triggered, the message returned to access is a mess for an average user. Is there a way to replace those messages with my own, p.e. like: "Deleting isn't allowed because data are used in other tables!" or "This name is in use!" It looks like I can catch the error in OnError event for form, but how can I override the error message - usual On Error routine doesn't work (Err.Number=0), and I'm afraid whatever message I'm programming, standard transaction error message gets displayed too. Thanks in advance! Arvi Laanemets |
Thread Tools | |
Display Modes | |
|
|