473,396 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

runtime 2001 Error

Hello,

I believe I have a malformed 3rd parm in the following line:

If DLookup("ProjectStatus", "tbl_Empl_Master", "ProjectStatus = " & "On-Board") > 0 Then

Here is the equivelant SQL:
Select * from tbl_Empl_Master where ProjectStatus = "On-Board"

Thanks in advance,
Rich
Aug 21 '07 #1
2 1415
Sorry, I posted the question too quickly.

Can anyone please help me understand the correct placement of both single and double quotes in this type of statement?

TIA,
Rich
Aug 21 '07 #2
If DLookup("[ProjectStatus]", "tbl_Empl_Master", "[ProjectStatus] = " & "On-Board") > 0 Then
If DLookup("[ProjectStatus]", "tbl_Empl_Master", "[ProjectStatus] = " & “’"&”On-Board"&”’”) > 0 Then
If DLookup("ProjectStatus", "tbl_Empl_Master", "ProjectStatus = "On-Board") > 0 Then

These are the diferent ways i set up my dlookups but I think you want to be useing a dcount as follows

If Dcount("ProjectStatus", "tbl_Empl_Master", "ProjectStatus = "&"On-Board") > 0 Then

And here are the notes and examples i keep in my treepad

' The DLookup function returns the field from the first matching record
' It is very touchy and criteria is optional

' DLookup("[FIELD]","TABLE/QUERY","CRITERIA")

DLookup("[FIELD]","TABLE","Year = " & TheYear)

[RegionCode] = DLookup("[Region Code]", "Region", "[Forms]![Market]![Region ID] = [ID]")

[Cust_ID] = DLookup("[Company]", "Users", "[Login] = " & "[Forms]![Login]![AskLogin]")

Location = DLookup("City", "Market", "[Market Name]='" & Me.Market_Name & "'")

FPQ_ID = DLookup("[ID]", "FPQ", "[FPQ Number] = " & "[FPQ_Number]")

' Here is the one to watch out for
ThePOID = DLookup("[ID]", "PurchaseOrders", "[PO Number] = " & "'" & [ThePO] & "'")


Me.CompanyID = DLookup("[companyID]", "Company", "[company]=" & [Forms]![Login]![Company])
Aug 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: yanwan | last post by:
I met this problem in executing a c++ project in visual studio. Does anyone have suggestions to resolve "error lnk 2001"? --------------------Configuration: reconstruction - Win32...
5
by: Susan Bricker | last post by:
Greetings! Can you help me? Here's the error: “Run-time error ‘2001’. You canceled the previous operation.” Here's the form description: has 2 controls involved with this error: =...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
2
by: Y2K | last post by:
First.. I sincerely appreciate any assistance in resolving this. I've searched the entire PC for assembly.adaptive.xsd, and it's non existent. Here's the problem: I've published a standard...
6
by: Widge | last post by:
I've been using code similar to this: Option Compare Database Private Sub Form_Open(Cancel As Integer) SetFilter
1
by: noneedforthis | last post by:
I'm a new user of Access/VB and ran in to this nasty wall. (Access 2003, VB6.3, Windows XP) Runtime Error 2001: You cancelled the previous operation. The highlighted line is the one where the...
7
by: David01 | last post by:
When I run some code behind a button i get a runtime error message. The strange thing is that the code run perfectly some months ago. Can some one help me ! Some additional information: The company...
7
jmoudy77
by: jmoudy77 | last post by:
I've got some vb code that gives me a "previous operation cancelled" error when I try and open the form as a subform in a tabbed control. When I open the form itself I don't get the error. Does...
7
by: W. eWatson | last post by:
I copied the following code from a matplotlib tutorial, and it fails. I'm using python 2.4 on Win XP. It's matplotlib-0.98.3.win32-py2.4exe. It fails in IDLE with a small window showing a runtime...
3
by: AccessBeetle | last post by:
I am creating simple login form with linked tables(atual tables are in SQL 2005) in access 2003. Here is my code. Option Compare Database Private Sub cmdSignIn_Click() 'Check to see if data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have 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
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...
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
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
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,...

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.