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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to avoid sql-server error after update?

Status
Not open for further replies.

fmientjes

Programmer
Mar 27, 2002
55
NL
I have a form based on a SQL-server table. In the table you cannot enter duplicate keys (e.g. debtornr).

I want to display a neat message when someone enters the same debtornr. The current SQL-server message looks quit frightening to a lot of users.

Which event do I have to trigger? I tried several ones, also tried to break in the message, but no results yet.

Can someone help me out?

Thanks,
Frans
 
You would not trigger an event, but you would need to trap the errors using the On Error Goto clause. you can look that up in Access help.
 
Thanks,

But where should the on error statement be?
On form_open event?

I cannot get the right trigger / event.
Do you know?

Frans
 
Have a look at the Error event of the Form object.
Another way is to play with the DLookUp function in the BeforeUpdate event procedure of the debtornr control.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top