DateSerial in Macro Condition

D

Dan

I have a macro that runs several queries and produces some various reports. I
also have some set up for thier specific day (ie Monday, Tuesday etc) However
there are some that only get ran on the 22 of every month. I used the
following in the condition:

DateSerial(Year(Date()),Month(Date()),22)

Works find for queries but I cant get it to work for my macro condition.
Any help is much appreciated. Thanks & Cheers
 
J

Jeff Boyce

Dan

If I recall correctly, a "condition" is a test (e.g., something = something
else).

I don't see any comparison in your expression...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Dan

Using DateSerial(Year(Date()),Month(Date()),22) the it runs the query
reguardless of the date.
If my understanding is correct it should run it if the date is the 22nd of
any month and any year, which is what I am looking for. Unless your
suggesting I use something like:

date()=DateSerial(Year(Date()),Month(Date()),22)
 
D

Dan

date()=DateSerial(Year(Date()),Month(Date()),22) Worked....Thanks Jeff for
getting the juices flowing. CHEERS!!! :)
 
J

Jeff Boyce

Glad it worked out.

Consider also another approach. Instead of using the DateSerial() function,
if you know that the Day(Date()) = 22, that should trigger also, right?


Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Top