467,119 Members | 1,156 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,119 developers. It's quick & easy.

DoCmd.OpenForm

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
  • viewed: 5415
Share:
4 Replies
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
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
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
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.

Similar topics

3 posts views Thread by Aravind | last post: by
15 posts views Thread by Thelma Lubkin | last post: by
2 posts views Thread by Mike | last post: by
2 posts views Thread by rturpyn@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.