Solved

The Open Form action was cancelled

Posted on 2006-11-08
5
494 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.
0
Comment
Question by:mustish1
  • 3
  • 2
5 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 250 total points
ID: 17899770
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.
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 250 total points
ID: 17899779
btw I recommend renaming Command11 to something more meaningful to you, like cmdEdit, cmdPrint, cmdRequest, or cmdWhatever.  
Command11 isn't exactly very descriptive.
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 250 total points
ID: 17899791
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
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 250 total points
ID: 17899825
XXX is 2501 as far as I remember
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 250 total points
ID: 17899837
Hi Jim, I think your right, I just tried a small test (DoCmd.SendObject then cancelled that) and I got 2501

0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question