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

DoCmd.OpenForm

P: n/a
I need help

I am trying to Open a FORM_A in a Single Form View for a selected
record on FORM_B which is in Datasheet View.

End user double clicks on a FORM_B (DataSheet View) to open FORM_A in a
Single Form View.

I have written my code as shown below
Me![PROJECT_NO] is the value of Project no from FORM_B which is
selected by end user.

With this value of Me![PROJECT_NO] selected I want to open FORM_A in a
filter mode depending upon value selected on FORM_B
Private Sub PROJECT_NO_DblClick(Cancel As Integer)
DoCmd.OpenForm "FORM_A", , , "[PROJECT_NO] = " & Me![PROJECT_NO]
End Sub

When run my code I get Run Time Errror #'2501'
Message "The OpenForm action was canceled"

I do not what I am doing wrong here

Thanking you in advacne. I will appreciate your help
Sunny
SIEMENS

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
jv
Do you some any code on FORM_A that might cancel the open process? Try
placing a breakpoint on the docmd.openform line and step through it to
see where the error occur.

Nov 13 '05 #2

P: n/a
JV

Thanks for your reply

I have put the break point at DoCmd.OpenForm statement and error occurs
at the same line where I have ask to open form using DoCmd.OpenForm

I do not have any other code on FORM_A

Thanks

Sunny



*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3

P: n/a
jv
The only other things that I could think of is to make sure that FormA
contains the Field Project_No and that it is a numeric field. Good
luck.

Julie Vazquez

Nov 13 '05 #4

P: n/a
SUNNY <su*********@siemens.com> wrote:
: I need help

: I am trying to Open a FORM_A in a Single Form View for a selected
: record on FORM_B which is in Datasheet View.

: End user double clicks on a FORM_B (DataSheet View) to open FORM_A in a
: Single Form View.

: I have written my code as shown below
: Me![PROJECT_NO] is the value of Project no from FORM_B which is
: selected by end user.

: With this value of Me![PROJECT_NO] selected I want to open FORM_A in a
: filter mode depending upon value selected on FORM_B
: Private Sub PROJECT_NO_DblClick(Cancel As Integer)
: DoCmd.OpenForm "FORM_A", , , "[PROJECT_NO] = " & Me![PROJECT_NO]
: End Sub

: When run my code I get Run Time Errror #'2501'
: Message "The OpenForm action was canceled"

: I do not what I am doing wrong here

: Thanking you in advacne. I will appreciate your help

You might have an incompatibility in the type of the table's
PROJECT_NO and the value after the =. If the field isn't numeric
then you'll need to use quotes -- '..' -- around the value
--thelma
: Sunny
: SIEMENS

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.