On Wed, 1 Feb 2012 06:31:34 -0800 (PST),
(E-Mail Removed) wrote:
>Hi I receive an error message
>
>here is what I wrote as formula
>
>DLookUp([PeriodNo],[TblPeriods],[Itemdate] & " between [PeriodStart] and [PeriodEnd]")
>
>Thanks for helping
Take another look at the Help for DLookUp. The function takes three arguments;
ALL THREE of them must be text strings (either text literals in quotes, or
variables which evaluate to a text string. The first argument must be a text
string containing the name of a field; the second a text string containing the
name of a table or query; the third a text string containing an (optional) SQL
WHERE clause without the word WHERE.
Try
DLookUp("[PeriodNo]", "[tblPeriods]", "[ItemDate] BETWEEN #" & [PeriodStart] &
"# AND #" & [PeriodEnd] & "#")
The & concatenation operator stitches bits of string together into one result
string; I'm including the # date delimiter.
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also
http://www.utteraccess.com