Open the Immediate Window (Ctrl+G), and enter:
? DLookUp("[Sum Of Sessions]","[2002/2003 Query]","Criteria = n")
Work on that until you get the desired result.
The 3rd argument is probably the issue.
If you really have a field called "Criteria", and the value to find is "n",
try:
? DLookUp("[Sum Of Sessions]","[2002/2003 Query]","Criteria = ""n""")
Explanation of how to build the 3rd argument for DLookup:
http://members.iinet.net.au/~allenbrowne/casu-07.html
--
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.
"Andrew Stanton" <an***********@hotmail.com> wrote in message
news:7f**************************@posting.google.c om...
Hi,
I have a query that returns a sum for all values found that match the
criteria.
I am wanting to place this value in a textbox on its own so I can
refer to it elsewhere.
I have used the dlookup function in the control source of the textbox
to do this, however I only seem to get an '#Error' returned.
When i initiate the query manually all is well - it simply returns the
error when it is embedded in the control source of the textbox:
=DLookUp("[Sum Of Sessions]","[2002/2003 Query]","Criteria = n")
Query: 2002/2003 Query
Field in query: Sum Of Sessions
Any help most most welcome
Ta vm