Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / October 2005

Tip: Looking for answers? Try searching our database.

Printing a Report on a Specific Day

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kellogg - 19 Oct 2005 17:01 GMT
I have a macro that will allow users to print specific reports by clicking on
a button.  On one day of the week I need a somewhat different report to
print, but I don't want to add another button to the form.  I would like the
macro to print the correct report by determining the day of the week from the
system clock.  I have tried several differnt filtes, but can't seem to get
the correct syntax.  Can someone point me in the right direction?
Nikos Yannacopoulos - 20 Oct 2005 10:31 GMT
Kellogg,

You've probably already discovered how to use conditions in a macro...
if not, while in Macro design, run menu item View > Conditions. This
allows you to execute the action next to a condition only if the
condition is met.
Now, the way to determine the current day of week, is through the use of
function Weekday. So, if you want a different report on, say, Monday,
then you would do something like:

Condition        Action
WeekDay(Date,0) = 1    OpenReport (report A)
WeekDay(Date,0) <> 1    OpenReport (report B)

HTH,
Nikos
Kellogg - 24 Oct 2005 18:35 GMT
I tried adding the condition, but when I save the macro it puts brackets
around the word date and gives me the error message "can't find the name
'Date' you entered in the expression".

> Kellogg,
>
[quoted text clipped - 12 lines]
> HTH,
> Nikos
Steve Schapel - 24 Oct 2005 18:43 GMT
Kellogg,

Try it like this...
 WeekDay(Date())=1

Signature

Steve Schapel, Microsoft Access MVP

> I tried adding the condition, but when I save the macro it puts brackets
> around the word date and gives me the error message "can't find the name
> 'Date' you entered in the expression".
Kellogg - 26 Oct 2005 01:37 GMT
This works just the way I had envisioned.

Thanks!!!

> Kellogg,
>
[quoted text clipped - 4 lines]
> > around the word date and gives me the error message "can't find the name
> > 'Date' you entered in the expression".
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.