Re: DLookup that isn't working
From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 01/17/05
- Next message: Al: "Extra data on report"
- Previous message: JWCrosby: "DLookup that isn't working"
- In reply to: JWCrosby: "DLookup that isn't working"
- Next in thread: JWCrosby: "Re: DLookup that isn't working"
- Reply: JWCrosby: "Re: DLookup that isn't working"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 17 Jan 2005 11:25:46 +0800
The 3rd argument for DLookup needs to be a string like this:
=DLookUp("[Combined]", "CombinedQuery",
"[LinkField] = " & [LinkField] & " And [Year]= " & [Year1])
It would probably be much more efficient to base the report on a query that
includes both tables, rather than use the DLookup().
-- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "JWCrosby" <JWCrosby@discussions.microsoft.com> wrote in message news:C347F742-5F45-4188-8267-2EFCABD4CD3B@microsoft.com... >I have a once-working Dlookup that has decided to quit. Here are the > particulars: > > tblTransactions > LinkField (PK, autonumber) > StudentName > > tblHistory > LinkField > Year (ex. 2003) > Class (ex. "P1") > Grade (ex. "S") > > tblTransactions and tblHistory are related in a one-to-many relationship > based on LinkField. > > QueryCombined (based on tblHistory) with 3 fields: > LinkField > Year > Combined (created by combining Class and Grade, ex. "P1S") > > In a report based on tblTransactions, I have in the detail area the > following: > StudentName > LinkField (though it's not visible) > A text box representing a year, named "Year1" > A calculated Control with the following Control Source: > =DLookUp("[Combined]","CombinedQuery","[LinkField]=[LinkField]" And > "[Year]=[Year1]") > > It is pulling up a Combined field from the query, but I get the same field > for every record. > > What am I missing?
- Next message: Al: "Extra data on report"
- Previous message: JWCrosby: "DLookup that isn't working"
- In reply to: JWCrosby: "DLookup that isn't working"
- Next in thread: JWCrosby: "Re: DLookup that isn't working"
- Reply: JWCrosby: "Re: DLookup that isn't working"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|