how to prevent debug(errors) from parameter query

D

Denver

I have a Button that opens a parameter query for sorting purposes....
so far the everthing is working EXCEPT THAT WHEN I CLICK THE
CANCEL BUTTON FROM THE PARAMETER VALUE DIALOG BOX it results to
debug or errors.

1.how can I prevent from this everytime the user click cancel?

thanks
 
J

John Spencer

What error do you get (2501)?

Probably you just need to add a bit of error trapping code to your code. It
would have helped if you had posted the code you are using.

Private Sub btnOpenQuery_Click()
On Error GoTo Proc_Error

'==========================
'Your current code
'==========================
Exit Sub

Proc_Error:
If Err.Number = 2501 Then
'Do nothing the user canceled
else 'Some other error, tell me about it
MsgBox Err.Number & ": " & Err.Description
End if
End Sub

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
D

Denver

thank you very very much..
i know this is simple but for me it is very hard because im not
a programmer...
but thank you very much
IT REALLY WORKS.


THANK YOU AGAIN

DENVER
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top