473,466 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Create 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_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 5923
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.