For a test try doing the DLookup in the VBA immediate window.
Try building it up a bit at a time to determine the cause.
?DLookup("ID","tblMain")
?DLookup("ID","tblMain","[FiscalYearInd]='2010'")
?DLookUp("[ID]","[tblMain]","[Last Name]='Artichoke'")
?DLookUp("[ID]","[tblMain]","[FiscalYearInd]='2010' and [Last Name]='Artichoke'")
If those work without an error then you can start looking at the expression in
the control and the control itself. For instance, does the control have the
same name as a field in the record source.
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
briank wrote:
> Thanks for the input John. I am still getting an error message in my report
> text box. To answer your question, the record source is a stored procedure
> that I was asked not to alter so I am trying a work around by using the
> dlookup command. Also criteria of 2010 is a text field. As a troubleshoot, I
> ran the dlookup with just the "[FiscalYearInd]=2010" as a criteria and
> although it pulled up data it appears to be the wrong data. I suspect that
> the second criteria will pull this together. Any thoughts on what I am doing
> incorrectly on this 2nd criteria?
>
|