I have a field that calculates the value of a load. It works great (before I made a change). I added a Dlookup function that determines whether are going to use an actual quantity of tractors or base it on the value of 1. The query (qryTruckRate) has a field txtQtyYN containing "N". if "N", the value will be caculated as if there was only 1 tractor, otherwise it will use the actual number of tractors on the load.
I am missing something in how my DLookup is working. I was hoping someone would find my error:
=IIf([txtQty]=0,"",IIf([ChkRT]="-1",(Round(([LM]/[LMPHold])+([txtTieDown]*(iif(Dlookup("[txtQtyYN]","qryTruckRate")="N",1,5)),[txtQty]),5)*2)*[txtTruckHrRate],(Round(([LM]/[LMPHold])+([txtTieDown]*(iif(Dlookup("[txtQtyYN]"="N","qryTruckRate")="N",1,5),[txtQty]),5)*1)*[txtTruckHrRate]))