View Full Version : DLookup in Report


Thecherub
03-01-2004, 11:31 AM
I have a report that uses values from a Query so far so good.

now I have values in a second query (History) and I sumed a Count in that query in a Third query (Historysum). Now I set an unbound field in my report to "[Historysum]![SumOfCountOfTime Off Booked]" now i get a enter Parameter value box insted of my query results?

Does anyone know how io can avoid this. In tried puting the Historysum in the main query but that just messed up the main querys data.

I'm quite stumped.

Rich
03-01-2004, 12:26 PM
You could use a subreport or DlookUp on the query

Thecherub
03-01-2004, 12:48 PM
I've already got 2 subreports. and i'm trying to avoid a third. Especialy since the value that i insert into the main has to be used for a calculation.

"=DLookUp([total],[Historysum])"

Is this right for the DlookUp code? I renamed the Count field to "total" for ease of checking. acording to help this is right but i'm getting a Parameter value box named looking for the value of total.

Rich
03-01-2004, 12:57 PM
I think it's =DLookUp("total","Historysum")

Thecherub
03-02-2004, 05:52 AM
I think it's =DLookUp("total","Historysum")


Thank you, thank you, thank you. :D :D :D

It works.

Damn didn't look far enuf. The code works but only for the first value. In other words the first value for Historysum!total is 2. It fills that through the whole report rather than sorting it as it should.

How can i get the DlookUp to sort in the report.

The Historysum query has the, Department, Lastname. Firstname and, total fields.

Thecherub
03-02-2004, 07:33 AM
Please disregard my last post.

I got everything working. I had to use subreports and querys out the yin-yang but everything works and works well.

I hope they don't want any more changes.