hide some warnings, but not others...? (1 Viewer)

madEG

Registered User.
Local time
Today, 05:12
Joined
Jan 26, 2007
Messages
309
Hello,

I have an application that I've built (2010 accdb/sql server 2012) that I'd like to reveal some 'warnings' while I hide some others.

At first I was using hide warnings so that users did see inert and delete messages, but then I noticed that doing so also hid the messages coming back from sql server for failed inserts when unique constraints thwarted inserts.

For example, when I was to insert a record and if the name collided with an already existing record - with warnings off - the process would complete but no record would appear since sql server said no...

Is there a list of messages/error messages that I can observe coming back from the server, and can someone point me to an example of how to do so?

Or will I have to programmatically test for the conditions I want to manage, and build my own messages?

Thanks!
-Matt G.
 

namliam

The Mailman - AWF VIP
Local time
Today, 11:12
Joined
Aug 11, 2003
Messages
11,695
will I have to programmatically test for the conditions I want to manage, and build my own messages?

That, sorry matt :(

Offcourse you can/should prevent duplicates ahead of time before even doing an insert
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:12
Joined
Sep 12, 2006
Messages
15,656
You need to investigate and choose between the subtle differences between

Docmd.openquery xxxxx and

Currentdb.execute xxxxx
(With and without dbfailonerror)


You can also test for errors before executing the query, or rely on the error condition raised by the query.

All a matter of what works best.
 

Users who are viewing this thread

Top Bottom