The Cancel arg in forms' Open event

J

JonWayn

What's the point of the Cancel argument, if every time it is set to True,
Access is going to complain that the Open event was cancelled?
 
R

Rick Brandt

JonWayn said:
What's the point of the Cancel argument, if every time it is set to True,
Access is going to complain that the Open event was cancelled?

Your calling code's error handler (it does have one right?) can check the
error number and ignore it if it is number 2501.

EX:

On Error GoTo ErrHandler

DoCmd.OpenForm "SomeForm"

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case 2501
'ignore
Case Else
'your normal error handling code
End Select
Resume Egress
 

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