adding a foreign table's variable to a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello!

i have used a query which multiplies [labor rates]*[labor hours] to make a
report. at the bottom of the report i need to multiply my results by a
variable defined in a foreign table, [Benefits Funds]. is there a way to
pull that variable from the table so i can use it for further calculations in
the report? i tried the Dlookup function but it only returns a null value:

=DLookUp("[Rate]","[Benefits Funds]","[Benefits Funds].[Funds]"="Cement
Masons Local 161 Benefit Funds")

thanks!
-ih
 
Why not include your [Benefits Funds] table in your report's record source
query and set the criteria under [Funds] to "Cement Masons Local 161
Benefits Funds" and then add [Rate] to your report?

If you insist on using DLookup(), try:
=DLookUp("[Rate]","[Benefits Funds]","[Funds]='Cement Masons Local 161
Benefit Funds'")
 
thank you.

i simplified the problem so that my post would be more easily understood...
i wanted to put the [benefits funds] table in the query but i couldn't for a
number of reasons, not the least of which was that 'cement masons...' was
only one example of the many multipliers i will need in the final report -
the [Benefits Funds] table is longer than just one field.

anyway, your expression with the single quotation mark works really well.
thank you so much!

-ih

Duane Hookom said:
Why not include your [Benefits Funds] table in your report's record source
query and set the criteria under [Funds] to "Cement Masons Local 161
Benefits Funds" and then add [Rate] to your report?

If you insist on using DLookup(), try:
=DLookUp("[Rate]","[Benefits Funds]","[Funds]='Cement Masons Local 161
Benefit Funds'")


--
Duane Hookom
MS Access MVP


ianalexh said:
hello!

i have used a query which multiplies [labor rates]*[labor hours] to make a
report. at the bottom of the report i need to multiply my results by a
variable defined in a foreign table, [Benefits Funds]. is there a way to
pull that variable from the table so i can use it for further calculations
in
the report? i tried the Dlookup function but it only returns a null
value:

=DLookUp("[Rate]","[Benefits Funds]","[Benefits Funds].[Funds]"="Cement
Masons Local 161 Benefit Funds")

thanks!
-ih
 
Back
Top