Thread: using DLookup in reports
06-05-08, 06:46 #1Registered User
- Join Date
- May 2008
Unanswered: using DLookup in reports
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];
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])
06-05-08, 07:43 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
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 foundI'd rather be riding on the Tiger 800 or the Norton