By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,689 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,689 IT Pros & Developers. It's quick & easy.

"The OpenForm action was canceled"

P: n/a

After creating a button on a (parent) form linking to another (child)
form, I received the following error when clicking on the command
button:

"The OpenForm action was canceled"

No the child form is not a subform.

I should also add that I created code in the properties window stating
that the "child" "number" field on the form (that I was navigating to),
was equal to the "autonumber" field that I was navigating from.

Also, on the child form I created code that equated certain other "text"
fields equal to fields on the parrent form in order to populate those
fields, i.e., first and last name.

Finally, the parent form is also a link child form to another parent
(again, not a subform). Yes, the first and last name fields is the
information, that appear in the second and third forms,and origionly
entered on the first and top form.

John
*** Sent via Developersdex http://www.developersdex.com ***

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Are you sure there are related records? Sounds like your error handling is
generating that message. Try a simplified version of your form linkage.
The command button wizard will walk you through creating an Open Form event
code that restricts related records to a specific value. Typically these
forms would have different record sources; yours sound like they are
repeating data. Again, typically subforms and/or Dlookup controls are used
to display related info not in the form's record source.
-Ed

"John Phelan-Cummings" <jp*********@hotmail.com> wrote in message
news:42**********@127.0.0.1...

After creating a button on a (parent) form linking to another (child)
form, I received the following error when clicking on the command
button:

"The OpenForm action was canceled"

No the child form is not a subform.

I should also add that I created code in the properties window stating
that the "child" "number" field on the form (that I was navigating to),
was equal to the "autonumber" field that I was navigating from.

Also, on the child form I created code that equated certain other "text"
fields equal to fields on the parrent form in order to populate those
fields, i.e., first and last name.

Finally, the parent form is also a link child form to another parent
(again, not a subform). Yes, the first and last name fields is the
information, that appear in the second and third forms,and origionly
entered on the first and top form.

John
*** Sent via Developersdex http://www.developersdex.com ***

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption
=----

Nov 13 '05 #2

P: n/a
John Phelan-Cummings wrote:
After creating a button on a (parent) form linking to another (child)
form, I received the following error when clicking on the command
button:

"The OpenForm action was canceled"


The form being opened is somehow being cancelled. You likely have code
in the on open event of the form which, for whatever condition, has
cancel = true. This will raise the error 2501 in the calling procedure,
that of the button.

Put error handling in your button code. At the beginning of the proc,
after dims, write:

On Error GoTo Err_Proc

Then, at the bottom of your procedure write something like the following:

Exit_Proc:

Exit Function

Err_Proc:

Select Case Err.Number

Case 2501 'form opening cancelled, bypass error message and end
procedure

GoTo Exit_Proc

Case Else

MsgBox "Error " & Err.Number & " " & Err.Description,
vbCritical, "Name of Button/Command Procedure", Err.HelpFile,
Err.HelpContext

GoTo Exit_Proc

End Select
End Function

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.