"solar" <sp*******@gmail.com> wrote in
news:11**********************@f14g2000cwb.googlegr oups.com:
Is there any possibility to suppress a message box from Access ? I
have a complicated but a good code that calculates the
possibilities in the before update event, and if a condition is
met, then it exits the sub.In short, if this condition is met,
then after the exit sub I get the following message box:
Runtime error 2105 you cant go to the specified recod
END DEBUG
If I click on End, then the code is perfect,everything I cleared
and I can begin anew.If only I could auppress the appearance of
the message box.Can someody help me ?
Well, if all you want to do is suppress the error message, you can
add an error handler in your code that ignores this error message.
It would be something like this:
Begin Sub
On Error GoTo errHandler
[code]
exitRoutine:
Exit Sub
errHandler:
Select Case Err.Number
Case 2105 ' can't go to specified record
' do nothing
Case Else
MsgBox Err.Number & ": " & Err.Description, ,"Error" &
End Select
Resume exitRoutine
End Sub
Now, that answers the question you asked, but I think it's
absolutely the wrong thing to do.
You need to determine which command is causing the error and figure
out how to avoid causing it. When the error message comes up, hit
DEBUG and then tell us which line is highlighted in yellow and one
of us can probably explain why you are encountering that problem and
how to avoid it entirely.
--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/