Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008

    Question Unanswered: using DLookup in reports

    Hi all,

    I have two tables, one for Children and another for their Parents.
    In the Children's tables there is a field [GuardianID] which holds the parents [GuardianID] key text field.
    The child' actual field is a Table/Query look up using:

    SELECT [Parents Register].GuardianID, [Parents Register].Forname, [Parents Register].Surname FROM [Parents Register];
    bound to column 1.

    I am designing a report to bring back the parents Surname depending on the child's guardianID record.
    I am trying to use the DLookup function to accomplish this.

    On running the report, all that is displayed is #Error

    (In vba the same dlookup returns error 13; type mismatch)

    The DLookup is as follows:-

    = DLookup("[Parents Register]![Surname]", "[Parents Register]", "[Parents Register]![GuardianID]" = [Reports]![Child_Parents]![GuardianID])
    Any help much appreciated.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    why not join this to the reports original source as part of the base query

    it will be much quicker to run, as there is no additional overhead in doing the the dlookup

    make sure you use a left join that selects all the rows from the current table, and only those rows from the guardian table where the guardian is found
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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