We help IT Professionals succeed at work.

What's wrong with this statement?

David_W_R
David_W_R asked
on
The expression below produces "#Error" in the Expr1 column of every record of the resulting Datasheet.
If I don't break out [BirthDate] from the quotes, Access "can't find the name BirthDate".

Expr1: DLookUp("[RMD]","[tbRMDpercents]","AgeEligible=Year(Date())-Year("+[BirthDate]+")")

RMD and AgeEligible are fields of tbRMDpercents.
BirthDate is a field included in one of the tables used to construct the query.

The expression          Age: Year(Date())-Year([BirthDate])            works ok

a few records in tbRMDpercents:
AgeEligible      RMD
      70             27.4
      71             26.5
      72             25.6
      73             24.7
Comment
Watch Question

Commented:
Hi, David-

Try this

Expr1: DLookUp("[RMD]","[tbRMDpercents]","[AgeEligible]=" & Year(Date())-Year([BirthDate]))

Thanks!

Author

Commented:
I really CAN go home for the weekend!  Many thanks.  Taking my situation into consideration, this was worth much more than 500 points!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.