D
DRBE
Hopefully this is a simple query, but I just keep getting stuck:
I am trying to use Dlookup on a form to look up the corresponding email
address for an agency.
I use this as a textbox control source field, with the aim of the
appropriate email address being displayed (which can then later me included
in an actual email from a command button)
Using Access 2000:
=DLookUp("[agency appointments email]","AgenciesTable","[AgencyName]=
""DuckandCoAgency""")
it works perfectly and the corresponding email address is returned.
However, when I replace "DuckandCo" with [Agency]
=DLookUp("[agency appointments email]","AgenciesTable","[AgencyName] =
""[Agency]""")
where the entry for the [Agency] field is DuckandCo
it just comes up blank. ( tested in on access 2003 it gives message "no
current record"
I also tried
=DLookUp("[agency appointments email]","AgenciesTable","[AgencyName] =
"[Agency]"")
but this gives the error
"the expression you entered contains and invalid syntax
you may have entered and operand without and operator"
presumably my quotes are in the wrong places. would appreciate any advice.
regards
Bruce
I am trying to use Dlookup on a form to look up the corresponding email
address for an agency.
I use this as a textbox control source field, with the aim of the
appropriate email address being displayed (which can then later me included
in an actual email from a command button)
Using Access 2000:
=DLookUp("[agency appointments email]","AgenciesTable","[AgencyName]=
""DuckandCoAgency""")
it works perfectly and the corresponding email address is returned.
However, when I replace "DuckandCo" with [Agency]
=DLookUp("[agency appointments email]","AgenciesTable","[AgencyName] =
""[Agency]""")
where the entry for the [Agency] field is DuckandCo
it just comes up blank. ( tested in on access 2003 it gives message "no
current record"
I also tried
=DLookUp("[agency appointments email]","AgenciesTable","[AgencyName] =
"[Agency]"")
but this gives the error
"the expression you entered contains and invalid syntax
you may have entered and operand without and operator"
presumably my quotes are in the wrong places. would appreciate any advice.
regards
Bruce