Dlookup HELP

  • Thread starter Thread starter FSUrules2883
  • Start date Start date
F

FSUrules2883

I am trying to use a DLOOKUP in a report To lookup a value in a stored
query from information that is the report. I have a report that gives
me a customers parent account name and I am trying to then use that
parent account name to look up a comment stored in another query.
This is how my formula looks

=DLookUp("TXTFIELD","Query","Query.ParentAccount"="ParentAccountFromReport")

Any sugesstions?
 
Perhaps something along the lines of
=DLookUp("TXTFIELD","Query","ParentAccount=""" & ParentAccountFromReport
& """")


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
I am trying to use a DLOOKUP in a report To lookup a value in a stored
query from information that is the report. I have a report that gives
me a customers parent account name and I am trying to then use that
parent account name to look up a comment stored in another query.
This is how my formula looks

=DLookUp("TXTFIELD","Query","Query.ParentAccount"="ParentAccountFromReport")

Any sugesstions?

You need to know the datatype of [ParentAccount].
If it is a Number datatype, then:

=DLookUp("TXTFIELD","Query","[ParentAccount] "= [Name of Control on
Report])

If [ParentAccount] is a Text datatype, then:

=DLookUp("TXTFIELD","Query","[ParentAccount] '"= [Name of Control on
Report] & "'")

Change Txtfield, Query, [ParentAccount] and [Name of Control on
report] to the actual names used.

Look up DLookUp as well as
Restrict data to a subset of records
in VBA help.
 
Back
Top