Solved

The Open Form action was cancelled

Posted on 2006-11-08
5
496 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 66

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 66

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 66

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

690 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