473,568 Members | 2,898 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

another Dlookup problem...

24 New Member
I'm creating a database for work and i've run into a snag. Currently i'm using to nested dlookup statements and they are searching for certain criteria in order to find the correct value the statement reads:

= DLookup ( "[tbl Cost Center]![Description]" ," tbl Cost Center", "[tbl Cost Center]![CC]= DLookUp("[tbl People]![CC]","tbl people","[tbl People]![EmployeeNumber]= Forms![Requests]![cmbRequestor]")")

i've swapped the quotations marks and have tried god knows how many syntaxs for numeric and text. The first dlookup criteria is text. the second dlookup criteria is numeric. I've exhausted everything i know how to do.

The error message is as follows:

"...Databas e can't parse the expression..."
Jun 4 '07 #1
11 5475
Rabbit
12,516 Recognized Expert Moderator MVP
=DLookup("[Description]" ,"[tbl Cost Center]", "[CC]=" & DLookUp("[CC]","[tbl people]","[EmployeeNumber]=[Forms]![Requests]![cmbRequestor]"))
Jun 4 '07 #2
vkong85
24 New Member
"...syntax error (missing operator) in query expression '[CC]='..."
Jun 4 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
"...syntax error (missing operator) in query expression '[tbl cost center]![CC]='..."
CC is a text value?

Expand|Select|Wrap|Line Numbers
  1. =DLookup("[Description]" ,"[tbl Cost Center]", "[CC]='" & DLookUp("[CC]","[tbl people]","[EmployeeNumber]=[Forms]![Requests]![cmbRequestor]") & "'")
Jun 4 '07 #4
vkong85
24 New Member
yes cc is a text value in the cost center database
Jun 4 '07 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Okay, then use the new code I provided.
Jun 4 '07 #6
vkong85
24 New Member
says that action failed... no error message provided...

action failed:
macro name: SetDept
Condition: True
Action name: Setvalue
Arguments:.....
Jun 4 '07 #7
Rabbit
12,516 Recognized Expert Moderator MVP
says that action failed... no error message provided...

action failed:
macro name: SetDept
Condition: True
Action name: Setvalue
Arguments:.....
You're trying to do this through a macro? I was not aware of that. I thought you were just using it as the control source of a textbox.
Jun 4 '07 #8
vkong85
24 New Member
yes im doing it through expression builder under the 'build event' option...

is there another way to populate the field without using dlookup?

what i'm trying to accomplish is filling a field with a value that is retrieved from another database so far as a 'username' or 'account number' is the same...
Jun 5 '07 #9
vkong85
24 New Member
ok so i was playing around with the macro and i seem to got it to work but there's another problem that popped up...

"The object doesn't contain the automation object ' description retrieved '. you tried to run a visual basic procedure to set a property or method for an object. However, the component doesn't make the property or method available for automation operations. Check the component's documentation for information on the properties and methods it makes available for automation operations."
Jun 5 '07 #10

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

Similar topics

7
2250
by: Tony Williams | last post by:
Does DLookup work in an expression in a query? I have this expression -(DLookUp("","tblmaintabs","= ")) Which works fine as a calculated control on a form but when I try to use it in a query as an expression I don't get any result. I want to use the Sum of the result in a query on which I will base a report. TIA Tony
5
2321
by: kevinjouco | last post by:
Hello Have searched the group for a solution to the following problem without success: Table 1 has Ref No (No Duplicates) & Min Max Value Fields ie Ref No 1 Min 1 Max 10 Ref No 2 Min 11 Max 20 etc Table 2 is linked by Ref No (Allows Duplicates) & Recorded Value
2
4138
by: ctyrrell | last post by:
I have read with interest the many discussions of the 3048 Error: Cannot open any more databases. I understand how the number of open Table ID's causes the problem. My question has to do with the usage of the Elookup routine as a substitute for Dlookup. I read that Dlookup 'does not clean up after itself'. Most of the discussion centered...
11
2208
by: MLH | last post by:
DLookup("", "tblPreliminaryVINs", "=Forms!frmVINODO!SerialNum") is giving me a Type Mismatch error. That's confusing to me and I don't know how to circumvent it. The field in tblPreliminaryVINs is a 17-char text field. Forms!frmVINODO!SerialNum is just an unbound textbox on a form (frmVINODO). I run the DLookup during the textbox's...
2
2343
by: boyleyc | last post by:
Hi all the following code works perfectly well. Basically it populates a series of check boxes on my form, depending on whether dlookup finds an associated record. The problem i have is that when the date (or xDate) goes over to the next month, dlookup returns NULL even though though there is a record. For example if CALWEEKSTART is...
1
4118
by: Beeker | last post by:
I have a table called 'RawData' that collects production data. We run a report on this data everyday to see the performance of each employee. I have another table called 'tblStandards' with standards for each area and an effective date of the standard. Any production numbers before the effectivity date will use the older standard and any on or...
2
2232
by: tomash | last post by:
Hi! I ve got two tables in Access 2007. I want to update a field of DataTable from another table, DataSumTable when two of their fields equals. ( the fields : Name and Period) I tried this sql code: UPDATE DataTable
2
1362
by: squiggly12 | last post by:
Hello all, I have this interesting problem and it has me scratching my head. I have updated a few forms to use CDOSYS to email instead of using the doCmd.SendObject. Dim objMessage As Object Dim strFromEmail As String Dim intCaller As Integer Dim strCallerComments As String Dim strCallerEmail As...
15
3099
by: rleepac | last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue This is a table used to assign an Age Correction value to hearing test results - since some degree of hearing loss naturally occurs with aging - OSHA lets us calculate that in...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
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...
0
7916
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. ...
0
8117
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...
0
6275
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...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
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...

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.