invalid syntax...

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have five columns in a query that display dates only
(data type is date). I need to create a report of the
query that shows in 'BOLD' dates no later than the past
30 days. I used the following code in the criteria field of
the date columns, but got an invalid syntax error (it
says 'you may have entered an operand without an
operator'):

if DateDiff("d",[DateField],date) <=30 then
[DateField].FontBold = true
else
[DateField].FontBold = false
end if

What could be wrong?
 
Tom,
Where did you put this code? In the query?

This is from your previous original post:
I need to create a report of the
query that shows in 'BOLD' dates no later than 30 days.

The code works in a Report's Detail Format event.
A query does not support this type of formatting.
Use your query as the recordsource of a report.

In any event, you must change my generic [DateField]
to whatever the actual name of the field is.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Tom said:
I have five columns in a query that display dates only
(data type is date). I need to create a report of the
query that shows in 'BOLD' dates no later than the past
30 days. I used the following code in the criteria field of
the date columns, but got an invalid syntax error (it
says 'you may have entered an operand without an
operator'):

if DateDiff("d",[DateField],date) <=30 then
[DateField].FontBold = true
else
[DateField].FontBold = false
end if

What could be wrong?
 
Fred,
Sorry, I was using it in the query.
Now I used it in the reports design view (code:
detail/format). But the all dates are in Bold, no matter
if days are later than 30 days. Below the expression

if DateDiff("d",[LC Sent],date) <=30 then
[LC Sent].FontBold = true
else
[LC Sent].FontBold = false
end if
 
It worked !!!!!!!!!!!!
I cannot believe this, the problem was [LC sent] wasn't in
the detail section.
Many thanks FRED
 
Back
Top