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

Error Messages

Status
Not open for further replies.

Klo

Technical User
Aug 28, 2002
86
US
I have a text file that I import to a table in Access 2000. This is done every day to update the table. Most of the time there is only one or two out of 32000 entries that are added. Access gives the usual error message about not being able to update 31999 records due to primary key violations, etc. Is it possible to change this message to say, for example, "three patient names were added out of 32XXXX" or something like that? The import happens automaticaly by a macro calling VBA code using an import specification.
Also, is it possible to export an Import Specification?
Thanks
 
As we can not se from your text where this err occours I am not sure that you can catch it.
But if you can, you could, via your error handler catch this err by using something like:

Err_Handler:
If err = 3245 then 'Your errors code nr)
msgbox "Your err text",,"Your Appname"
else
msgbox err.description,,"Your AppName"
end if
etc.

Herman

They say that crime doesn't pay... does that mean my job is a crime?
 
It might no be an error as such. If you try to import data to a table and some of the data already exists then access pops up a message saying "Access could not append all the data to the table" with info as to what and why. There is a little icon in the box with an "I" in it. Maybe this means Information?
 
Ok so you ar not getting this err during the import, fine then we should be able to control it.

Yes the "I" is for information.

But if we have the data then we really do not care about this error as we only want the new data so you could have your err handler like this:
Err_Handler:
If err <> 3245 then 'Your errors code nr)
msgbox err.description,,"Your AppName"
end if
etc.
Its not the prefered way but in an access base it would work fine

Herman

They say that crime doesn't pay... does that mean my job is a crime?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top