We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

The Open Form action was cancelled

mustish1
mustish1 asked
on
Medium Priority
513 Views
Last Modified: 2008-02-01
Hi: When i click on cancel it gives that message. Can any one please help me how to i remove this message as i just want when i press cancel it goes back to the button.

The Open Form action was cancelled

Private Sub Command11_Click()
DoCmd.OpenForm "frm_Request_Edit", acNormal
End Sub

Thanks.
Comment
Watch Question

SQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
This is one of the RARE times I recommend 'On Error Resume Next', as M$ doesn't have a way to handle this...

Private Sub Command11_Click()
On Error Resume Next
DoCmd.OpenForm "frm_Request_Edit", acNormal
End Sub

Also, make sure you have error handling in frm_Request_Edit, in case anything blows up here.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Jim HornSQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
btw I recommend renaming Command11 to something more meaningful to you, like cmdEdit, cmdPrint, cmdRequest, or cmdWhatever.  
Command11 isn't exactly very descriptive.
CERTIFIED EXPERT
Top Expert 2006
Commented:
Or u can check for the error code as there may be a real problem of the form not opening

Private Sub Command11_Click()
    On Error Resume Next


    DoCmd.OpenForm "frm_Request_Edit", acNormal
    If err.number <> 0 and err.number <> XXX then  msgbox err.Description
end sub


just cant remember the error number
if u did this


Private Sub Command11_Click()
    On Error Resume Next


    DoCmd.OpenForm "frm_Request_Edit", acNormal
msgbox err.number
    If err.number <> 0 and err.number <> XXX then  msgbox err.Description
end sub


it will then give u the error number when u hit cancel
then replace XXX with that error number


End Sub
Jim HornSQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
XXX is 2501 as far as I remember
CERTIFIED EXPERT
Top Expert 2006
Commented:
Hi Jim, I think your right, I just tried a small test (DoCmd.SendObject then cancelled that) and I got 2501

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.