How to trap the Database Error and substitute it with the Mesgbox
How to trap the Database Error and substitute it with the Mesgbox
(OP)
Hello.
When the forms are closed the access tryes to save the unsaved records entered, but if some fileds left null it will give an ODBC error. I would like to know if anyone konws how trapt the error and on wich even should I place the the undo command or some sort of MsgBox which would ask user to either complete the record entered or undo the last action and exit the application. I would appreciate if you can help me.
Regards.
When the forms are closed the access tryes to save the unsaved records entered, but if some fileds left null it will give an ODBC error. I would like to know if anyone konws how trapt the error and on wich even should I place the the undo command or some sort of MsgBox which would ask user to either complete the record entered or undo the last action and exit the application. I would appreciate if you can help me.
Regards.
RE: How to trap the Database Error and substitute it with the Mesgbox
Mohamed Aly
samara_79@hotmail.com
RE: How to trap the Database Error and substitute it with the Mesgbox
I tried both but the the error is raised by the MSSQL server. MS Access Forms I have developed has been based on the MSSQL linked tables. The errors are ODBC connection failed and cannot insert null value.
The mesages which I put are dispalyed but the the system errors continue to appear afterwards befor the form is closed and I am afraid it can be confusing for the back end user. If you have delt with similar problem Can you give me more specific way to trap the error and sbustitue it with the meseage I want the user to see.
Ragards
RE: How to trap the Database Error and substitute it with the Mesgbox
"VBA and Custom Functions" category,
".Basic Error handling - hide an Access error message or substitute your own"
If this doesn't work, please post yur problem/solution here, we can then incorporate it into the FAQ.