Solved

The Open Form action was cancelled

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Launch app from Access custom ribbon 8 33
Any Way to Print an Import Spec? 3 32
Filter a form 8 15
Part 2 to aggregate query solved qtn 12 41
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
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…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

823 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