472,364 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,364 software developers and data experts.

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
4 5781
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aravind | last post by:
Hi folks. I have 2 forms, frmMain and frmHistory. frmHistory has a field called Return. frmMain has a command button called "Due Today" (which will henceforth be called as DT), which opens...
6
by: beowulfs | last post by:
Here's what I've got: I've got a form with combo boxes. you can select already existing company names or type in new ones. if you type in a new one, it prompts you to double click the combo...
3
by: Lyn | last post by:
Hi, I have a Search input form which collects from the user a person's name. I am using LIKE with a "%" suffix in the SQL so that the user does not have to type in the full name. When they hit...
15
by: Thelma Lubkin | last post by:
formA determines some_where and some_value and issues docmd.close ,Me docmd.openform "formB", , ,some_where, , ,some_value formB receives the correct some_where and some_value After...
8
by: John Welch | last post by:
I have a command button with the following code: DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1" (SearchAssignmentID is the PK, auto number) When it runs, the form opens but...
2
by: Mike | last post by:
I am trying to open a search results form based on the input from a prompt form. I am using the following code: --- Begin Code --- Private Sub btnSearch_Click() 'Dim Variable and assign data...
9
by: keliie | last post by:
Hello (from Access novice), I'm building a switchboard form (using a Treeview object). The treeview is populated by two tables (tblSwitchboardParent and tblSwitchboardChild). Within...
2
by: rturpyn | last post by:
I want to simply open a form, I don't want to limit the records returned. I'm using the code.... DoCmd.OpenForm "frm_GSG_Access_Rights", acFormDS, , When I enter something in the where...
3
martintallett
by: martintallett | last post by:
Help! I am trying to replace the Access Find button functionality on an old database. I can make it work when I use a basic form with bound fields and a button which shows a popup form which...
1
by: silen | last post by:
i am using Access2000. Currently i had a main form call "frmDownload" and sub form "fsubAdmmission". Under the fsubAdmmission, i do have another sub form "fsubHospital". Once i link my application to...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.