471,579 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Can i suppress Acess message ?

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 ?

Feb 13 '06 #1
2 4672
"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 ?


Yes, look up "Error Handling" in any good Access book. In your
case, I'd add a statement that handles error 2015, but We would
need to see your code before giving you specifics.
--
Bob Quintal

PA is y I've altered my email address.
Feb 14 '06 #2
"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/
Feb 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Doug Ly | last post: by
6 posts views Thread by Ron St-Pierre | last post: by
3 posts views Thread by Eddy Ilg | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
1 post views Thread by lumer26 | last post: by

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.