The Cancel arg in forms' Open event

  • Thread starter Thread starter JonWayn
  • Start date Start date
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?
 
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
 
Back
Top