SetWarnings Method

PaulA

Registered User.
Local time
Today, 11:31
Joined
Jul 17, 2001
Messages
416
I submitted an earlier problem about using SetWarnings but now have more information that clarifies the problem:

I wanted to turn off an expected warning which says:

"Microsoft Access was not able to append all the data to the table. Do you want to proceed anyway?"

I wanted this turned off because I don't want the user to be able to click "Yes" (by accident) on this message. "Yes" turns out to circumvent the error handler. The response should always be "no" so the error handler can then go into action.

If I use SetWarnings to turn off the system message, it will be as if the user clicked "Yes."

Is there any way of doing this so the system thinks the response was "No"?

Thanks.

Paul
 
This message comes up because you are trying to insert data that violates data integrity. What you need to do is first diagnose why you have these issues and resolve before appending the data.
So, if the issue is duplicate records that break the Primary Key rules, then eliminate the dupes ... if the issue is that it violates table validation rules, resolve those ... if the tables relating to the table being appended to need to have related records, process them first ...
Bottom line, there is a reason why you are getting that message box. Resolve that and you won't get it!:D
 
Thanks for the response--

The error handler is being used in an automated data import system as a safeguard. Unfortunately, this might be the first line of identifying the error due to the complexity of the system of which many individuals are involved.

I was hoping the error handler allow importing of "good" data and screen out and identify files with questionable data.
 
Perhaps you can write a pre-screening process that will clean the data before it goes through the automated process. Import the data into a separate table and then do the comparisons, removing records that violate the architecture. Then, write back the file for the automated process.
 
Last edited:
Good plan--

Good plan--

I had another situation that arose that prompted me to realize that I would need to set up a pre-screening process before the final appending to the final table.

Thanks.
 
Now, is it posible to make the message just not show up and be taken as a "yes"?

Thanks,
George
 
I forgot, I have set all warnings off but this one still manages to pop up.
 

Users who are viewing this thread

Back
Top Bottom