Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can i suppress Acess message ?

Status
Not open for further replies.

samotek

Technical User
May 9, 2005
197
BG
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 ?



 
And which code is highlighted when you click on DEBUG instead of END ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes, As PHV is intimating, the message box is being evoked, because there is an error in your code.

To avoid the message, is very sinmple.

Private Sub xxxx_BeforeUpdate(Cancel As Integer)
On Error GoTo ErrMsg


...your code...

Exit Sub

ErrMsg:
If Err.Number = 2015 Then
Exit Sub
Else
MsgBox Err.Number & ": " & err.Description
End If
Exit Sub

BUT, YOU"RE NOT SOLVING THE PROBLEM, just avoiding it!

Consider PHV's suggestion.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top