Help needed with combined Dlookup/DatePart Syntax

T

Tony Ciconte

I am using Acc97 and trying to get the following instruction to work
in the OnOpen event of a report:

DLookup("[GiftAmt]", "tblTempRevenueByFY", DatePart("m", [GiftDate]) =
1)

The table tblTempRevenueByFY exists, with data, as do the fields
"GiftAmt" and "GiftDate". However, when I try to preview the report, I
get 2465 error that says it cannot find the field "GiftDate". I have
tried every combination of quotes, double-quotes, parentheses, etc.
that I can think of and get mostly compile errors. I have also
searched the Google groups for insight without avail.

Any and all help is greatly appreciated

JM
 
V

Van T. Dinh

Each of the argument of DLookUp must be a String. In you posted expression,
the 3rd argument is not a String.

Not sure what you are trying to do but my guess is:

DLookup("[GiftAmt]", "tblTempRevenueByFY",
"DatePart(""m"", [GiftDate]) = 1")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help with DLookup in a Report 4
Help with dlookup 3
Syntax problem with Dlookup 2
DLookUp syntax help please 6
Help with DLookup 4
dlookup help needed! 2
Help with DCOUNT syntax 2
Help with DLookup please 4

Top