Dlookup function problem...

soupisgood84

New member
Local time
Today, 06:32
Joined
Jun 14, 2007
Messages
4
I am getting data from a query that shows how much a department spent for the year. In another table there is a projected about for the year. In a report I would like the projected amount to be subtracted from the actual amount spent....

Having a little trouble with my dlookup function:
Code:
=DLookUp("Hardware","tblBudget","Reports!rptBudgetUnbound!Department")
I put this in the control source of a txtbox.

Any help would be greatly appreciated.
 
Code:
=DLookUp("Hardware","tblBudget","Reports!rptBudgetUnbound!Department")
Plus one more hint - your Where doesn't compare to anything. In other words what is "Reports!rptBudgetUnbound!Department" supposed to be equal to?
 
Well, I figured that it should be called this way because the report is divided by department. So for each department name there will be a different total.
 
I should also state that with the above code I go the txtBox to display the first value, but it didn't change for each department.
 
Okay, I'll be more explicit:

=DLookUp("[Hardware]","tblBudget","[Department]=" & Reports!rptBudgetUnbound!Department)

And if Department is text and not a number:

=DLookUp("[Hardware]","tblBudget","[Department]='" & Reports!rptBudgetUnbound!Department & "'")
 
Thank you.......I have been trying to make this work for like 2 days. Thanks again!!
 
one of these days i swear im going to remember the ampersand and quotations BEFORE i cuss and swear for three days
 

Users who are viewing this thread

Back
Top Bottom