473,659 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_DblC lick(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 5979
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*********@si emens.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_DblC lick(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
3974
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 frmHistory and filters it to display records where the value of Return is Null
6
4195
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 box if you want to add a new company. when you double click it brings up the new company form so you can enter the rest of the information besides just the name there. This all works. Here's what I want:
3
4510
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 the Search button, a query is run to search the Person table for a match. This produces a recordset (I am using ADO). If the RecordCount is zero, they get a No Match message. If the RecordCount is 1, a DoCmd.OpenForm is performed to open the...
15
3878
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 completing its work formB issues docmd.close ,Me docmd.openform "formA"
8
13204
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 shows all records, rather than going to the one I want. If I look at the form in design view, it shows 'SearchAssignmentID=1' (without quotes) as the filter in the properties list. frmSearchAssignments is bound to a query qrySearchAssignments....
2
6843
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 Dim srce As String, fstnme As String, lstnme As String, bidnum As String srce = Me.Source_Control If Not IsNull(Me.Text18) Then
9
3516
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 tblSwitchboardChild, I have a string field called ChildArgument that contains string text of VBA code (e.g., DoCmd.OpenForm "myForm"). When users click on various portions of the Treeview object I want the Tree to either expand or open the report / form.
2
387
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 ("Elist_Caption = 'GSG Model'") it does return my form with only 1 record. What am I missing? Thanks, -Turp
3
4883
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 then finds the record the user wants then does a GoToRecord on the basic form. However... When I try to put this to work in the real world the form with the record context to GoToRecord is a subform and it only partially works.
1
2714
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 database A, when "frmDownload" loaded, it does successfully create "fsubAdmmission" object and i am able to assign "fsubAdmmission.form.recordsource". Once i link my application to database B, when "frmDownload" loaded, it failed to assign...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.