473,321 Members | 1,667 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,321 software developers and data experts.

another Dlookup problem...

24
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:

"...Database can't parse the expression..."
Jun 4 '07 #1
11 5455
Rabbit
12,516 Expert Mod 8TB
=DLookup("[Description]" ,"[tbl Cost Center]", "[CC]=" & DLookUp("[CC]","[tbl people]","[EmployeeNumber]=[Forms]![Requests]![cmbRequestor]"))
Jun 4 '07 #2
vkong85
24
"...syntax error (missing operator) in query expression '[CC]='..."
Jun 4 '07 #3
Rabbit
12,516 Expert Mod 8TB
"...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
yes cc is a text value in the cost center database
Jun 4 '07 #5
Rabbit
12,516 Expert Mod 8TB
Okay, then use the new code I provided.
Jun 4 '07 #6
vkong85
24
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 Expert Mod 8TB
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
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
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
vkong85
24
i figured out the problem. for future reference when using macro's to build an expression that will retreive a string value do not use an equals (=) sign in the expression field. the equal sign will command access to search for a property with the retrieved name which in many cases will give an error message. thanx rabbit for the help!
Jun 5 '07 #11
Rabbit
12,516 Expert Mod 8TB
i figured out the problem. for future reference when using macro's to build an expression that will retreive a string value do not use an equals (=) sign in the expression field. the equal sign will command access to search for a property with the retrieved name which in many cases will give an error message. thanx rabbit for the help!
Not a problem, good luck.
Jun 5 '07 #12

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

Similar topics

7
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...
5
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...
2
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...
11
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...
2
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...
1
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...
2
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...
2
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...
15
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.