Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookUp expression (2000 SR-1)

    Hi,

    I'm not really that experienced with Access, so please excuse the naivete of this question.

    I inherited a database from someone that includes this expression in a report field:

    =DLookUp("[CorrDesc]","Corrections","[Corrections]![CorrID]=" & [CorrID])

    I can figure it out except for the "[Corrections]![CorrID]=" part. What does that mean?

    Thanks,
    Bob

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DLookUp expression (2000 SR-1)

    The third argument to DLookup, <font face="Georgia">"[Corrections]![CorrID]=" & [CorrID]</font face=georgia>, provides the where-condition (criteria) that must be satisfied. If Corrections is a table, the author could have left out <font face="Georgia">[Corrections]!</font face=georgia>. The where-condition compares the CorrID field in the Corrections table to the current value of CorrID in the report - when this expression gets to be evaluated, the last [CorrID] is replaced by its value for the current record, since it is outside the quotes. For example, if CorrID = 37 for the current record, the expression to be evaluated is <font face="Georgia">=DLookUp("[CorrDesc]","Corrections","[Corrections]![CorrID]=37")[/georgia. So the DLookup expression says "Look up the CorrDesc field in the Corrections table in the record for which the CorrID field is equal to 37".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •