Solved

The Open Form action was cancelled

Posted on 2006-11-08
5
491 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MS Access query date sorting question 7 12
Dateadd 3 22
Syntax error with between dates 6 18
Access 2016 Merge Tables 8 28
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now