Forum Discussion

Tony2021's avatar
Tony2021
Steel Contributor
Apr 28, 2022

#Error on New Record

Experts, I am trying to get rid of the #error on the new row in my datasheet (pic below).  

I am using this formula:

=iif(IsError(DLookUp("[Rate]","qryPricingNow","[ProjID]=" & [ProjID])),"",DLookUp("[Rate]","qryPricingNow","[ProjID]=" & [ProjID])

 

However, the #Error still shows on the new record line

Not sure if my approach is correct?

 

here is qryPricing if needed:

SELECT tblPricing.ID, tblPricing.ProjID, tblPricing.Rate, tblPricing.PeriodID, tblDates.DateStart, tblDates.DateEnd, tblDates.NameOfDate
FROM tblPricing INNER JOIN tblDates ON tblPricing.PeriodID = tblDates.ID
WHERE (((tblDates.DateStart) Between Date() And (tblDates.DateStart)<[DateEnd]));

 

thank you

#error is on the new record

 

  • try this:

    =DLookUp("[Rate]","qryPricingNow","[ProjID]=" & Nz([ProjID], 0))
  • arnel_gp's avatar
    arnel_gp
    Steel Contributor
    try this:

    =DLookUp("[Rate]","qryPricingNow","[ProjID]=" & Nz([ProjID], 0))
    • Tony2021's avatar
      Tony2021
      Steel Contributor
      Perfect! Much cleaner too. thank you very much.

Resources