DLookup in Control Source (1 Viewer)

yuccakid

New member
Local time
Today, 18:13
Joined
Apr 28, 2000
Messages
9
I have entered a DLookup =DLookup("[Referral]","tblRefer","[ReferID]=" & Forms![frmReferral]!ReferID) and it works, but only if the frmReferral is Open. Anything I can do without having to open the other form?
 

Axis

Registered User.
Local time
Today, 18:13
Joined
Feb 3, 2000
Messages
74
You have to pass along criteria for the DLookup to evaluate. Either you allow the user to pick criteria from a form (as you've already done) or you hardwire in a criterion that can't be changed by the user.
 

yuccakid

New member
Local time
Today, 18:13
Joined
Apr 28, 2000
Messages
9
Thanks, Axis. But how do I "hardwire a criterion"?
 

Axis

Registered User.
Local time
Today, 18:13
Joined
Feb 3, 2000
Messages
74
By building it into the function, such as
DLookup("[Referral]","tblRefer","[ReferID]=1234")
Of course this has very limited application, since you'd always be looking up the same thing.
Where are you using the DLookup? Give me a better idea of the problems and I'll try to think of another solution for you.
 

Users who are viewing this thread

Top Bottom