473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Custom Erorr Message?

1
Hi Everyone
i have a table with tow column "Err Number" And "Custom Message"
now! Please help me that how can i use the onErorr event to change the default message with my "Custom Message" by using this table.
i now that i can use this metode for one message.
Expand|Select|Wrap|Line Numbers
  1. if DataErr = 0000 then
  2.  msgbox  "xxxxxxxxxx"
  3. Response=acDataErrContinue
  4. end if
  5.  
but for all Erorr i have to Write all Message but by using this table i think that i can solve this Problem So Please Help Me.Sorry for my poor english
Regards.
[email removed]
Mar 18 '07 #1
3 1389
missinglinq
3,532 Expert 2GB
Assuming the following:
Custom Message Table name = CustomErrorTable
Custom Message field = ErrorDescription
Error Number field = ErrorNumber

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2.   CustomMessage = DLookup("[ErrorDescription]", "CustomErrorTable", "[ErrorNumber] =" & DataErr)
  3.   resp = MsgBox(CustomMessage, vbExclamation)
  4.   Response = acDataErrContinue
  5. End Sub
  6.  
If you go to copy and paste the code, don't forget to scroll and get the hidden part of the code!
Mar 19 '07 #2
missinglinq
3,532 Expert 2GB
Note that the above code is dependent on CustomErrorTable having a comprehensive list of error codes! I used such a table and then changed the messages for the errors I was concerned with!
Mar 19 '07 #3
missinglinq
3,532 Expert 2GB
To avoid having to use a comprehensive list of error codes, I've modified the above code (added the bolded code) so that an error code not listed in your custom error table will be handled by Access' own error message.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2. If DCount("[ErrorNumber]", "CustomErrorTable", "[ErrorNumber] =" & DataErr) > 0 Then
  3. CustomMessage = DLookup("[ErrorDescription]", "CustomErrorTable", "[ErrorNumber] =" & DataErr)
  4. resp = MsgBox(CustomMessage, vbExclamation)
  5. Response = acDataErrContinue
  6. End If
  7. End Sub
Mar 19 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Hiusing Ngai | last post by:
Hello, I'm porting some C code to VC++ 7. A line of C code is: int (*v); and the C code allocate memory: v = calloc (width*5, sizeof **v); The VC++ 7 has the following erorr when I compile...
5
by: perpolis | last post by:
hi how can i handle dataset erros in the datagrid which is bound to a datatable??
1
by: TARUN | last post by:
Hello All, I am facing problem regarding Atlas. I have install the AtlasSetup.msi in my .NET framework 2.0, and i open the new Atlas Website...... Let me first explain the my senario, I...
10
by: Muffin | last post by:
I am a little new to C# and an have a hard time understanding why I get a nonstatic error. I create an object in my main form that has member properties by using a control. From another form/dialog...
2
by: chitra lekhaa | last post by:
#include<stdio.h> #include<conio.h> these two are important for my program but this only are giving erorr for me the file is not opening
1
by: preeti13 | last post by:
i am trying to dispaly a datagrid but getting the erorr please any one help me with this. private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page...
1
by: RAJAKUMARMCA | last post by:
what are the erorr in c how to use 1bit for int data type, so what is its range?
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.