Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup problems

Status
Not open for further replies.

soupisgood84

Technical User
Apr 17, 2007
45
US
Is there something wrong with my code?
I keep getting the wrong value on this function. I get the value that comes next on my list.
Code:
=DLookUp("DepartmentName","tbl(dropdown)Departments","DepartmentNumber =" & "'" & [DepartmentNumber] & "'")
I also tried...
Code:
=DLookUp("DepartmentName","tbl(dropdown)Departments","DepartmentNumber =" & [DepartmentNumber])
 
Can you explain a little more? What do you mean by next value? Have you checked the value of DepartmentNumber?
 
The value is fine.
I am trying to get my form to return a name opposed to a number. When the function returns a name it, for some odd reason, is the name of the next row on the table.
 
I have never seen this happen, so I cannot help, sorry.
 
Have you tried replacing [departmentnumber] with a number to make sure if you used a constant that your expression is working.

example

=DLookUp("DepartmentName","tbl(dropdown)Departments","DepartmentNumber =2")

If this is working then you may want to isolate the value for deparmentnumber

ck1999

PS
Where do you have the above located and where is it pulling the value for the departmentnumber from

 
Have you tried =DLookUp("[DepartmentName]"..... ?

Did you hear about the Buddhist who refused Novocain during a root
canal? He wanted to transcend dental medication.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top