473,322 Members | 1,241 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,322 software developers and data experts.

handle errors 2279 & 2113 within form error trigger

mseo
181 100+
hi,
I have a problem errors handling
I use this trigger code for handling an error (2279)
but I can not handle more than one error using this code
I tried this syntax within the below mentioned code
Expand|Select|Wrap|Line Numbers
  1. Const INPUTMASK_VIOLATION = 2279 & 2113
but it doesn't work at all
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2.    Const INPUTMASK_VIOLATION = 2279
  3.    Dim Msg As String
  4.    If DataErr = INPUTMASK_VIOLATION Then
  5.       Select Case Screen.ActiveControl.Name
  6.          Case "homePhone"
  7.             Beep
  8.             MsgBox "The phone you entered is invalid!", vbCritical
  9.             Me.HomePhone.Undo
  10.          Case "BirthDate"
  11.             Beep
  12.             MsgBox "The birth date you entered is invalid!", vbCritical
  13.            Me.BirthDate.Undo
  14.          Case Else
  15.             Beep
  16.             Msg = "an error"
  17.             MsgBox Msg & Screen.ActiveControl.Name & "!"
  18.             Me.Undo
  19.       End Select
  20.       Response = acDataErrContinue
  21.      End If
  22. End Sub
I need to handle more than one error in the same form using this syntax because it defines the fields that causes the error
I appreciate any suggestion
thank you very much
Jun 2 '10 #1

✓ answered by Dan2kx

Would this work?

Expand|Select|Wrap|Line Numbers
  1. Const INPUTMASK_VIOLATION = 2279
  2. Const INPUTMASK_VIOLATION2 = 2113 
  3.    Dim Msg As String 
  4.    If DataErr = INPUTMASK_VIOLATION OR _
  5.       DataErr = INPUTMASK_VIOLATION2 Then 
  6. .........

2 4098
Dan2kx
365 100+
Would this work?

Expand|Select|Wrap|Line Numbers
  1. Const INPUTMASK_VIOLATION = 2279
  2. Const INPUTMASK_VIOLATION2 = 2113 
  3.    Dim Msg As String 
  4.    If DataErr = INPUTMASK_VIOLATION OR _
  5.       DataErr = INPUTMASK_VIOLATION2 Then 
  6. .........
Jun 2 '10 #2
mseo
181 100+
thank you
it works great
appreciate your help
Jun 2 '10 #3

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

Similar topics

1
by: Sean Abrahams | last post by:
The following is a reprint of a message I sent to the tutor list a long time ago, that I haven't gotten around to discussing with anyone else and failed to hear a reply on the tutor list. Hoping...
2
by: Josué Maldonado | last post by:
Hi list, That's the question, anyone knows a way to do that? Thanks in advance, Josue Maldonado.
2
by: Eric Zechman via .NET 247 | last post by:
I have a project in which I get xml posted via a hidden form field (data=<xml></xml>). People are entering names like Bill & Sandy Smith. this is coming over as:...
3
by: Jeremy | last post by:
I am creating a form that a person enters a date span in yyyymm form. I want a box to pop up that tells the user "Please enter date in correct format" if the user has entered the data incorrect. I...
4
by: atv | last post by:
Whatis the proper way to handle errors from function calls? For example, i normally have a main function, with calls to mine or c functions. Should i check for errors in the functions called...
3
by: ShaneO | last post by:
Is there a way to discover the starting X & Y position (in Pixels) of a Cell within a DataGridView control on a Windows Form? (VS2005) I've searched everywhere, and tried everything I can think...
1
by: thecaptainsdad | last post by:
Hello, can anyone advise how I might retrieve the handle to a textbox on a form or report? I ultimately want to count the number of lines within that textbox, and resize the text accordingly, so that...
1
by: degno84 | last post by:
hi.. i have a problem with this simple trigger! I wont to insert a row in the same table where I update a value. The trigger is that: CREATE OR REPLACE TRIGGER LOG_SPOSTAMENTI_NEW_DEST AFTER...
0
by: bainy333 | last post by:
Hello there, I am developing a website that requires use of masterpages and content pages. I have also created a web user control, which requires use of from tag in it. This user control is then...
0
by: Jean-Paul Calderone | last post by:
On Mon, 5 May 2008 19:10:39 +0200, Terry Jones <terry@jon.eswrote: You can do this (if you replace `pass´ with `None´, anyway) or you can pass `consumeErrors=True´ to the `DeferredList´...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.