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 / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

Using date functions to automatically advance the date on a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jch461 - 28 May 2008 09:36 GMT
I am trying to use a date function with arguements to assign a specific day
to a form.  For example,  using the =date() function on the form would put in
todays date.  I need to know what arguements I would have to put in to
advance the date to a certian day... say like next sunday.  The function
should allow the form to be printed with next sunday's date on it no matter
what day it it printed on.  Say I printed the form today... it would have
next sunday's date already on it.  Also I would like it to advance to the
next sunday as soon as next monday arrives.  Thanks in advance!  I used to
know how to do this but i simply cannot remember.
Klatuu - 28 May 2008 15:41 GMT
This expression will return the Sunday of the week the date is in.  For
Sunday, it will return the current date, for every other day, it returns the
next Sunday date:

dateadd("d",choose(datepart("w",date),0,6,5,4,3,2,1),date)
Signature

Dave Hargis, Microsoft Access MVP

> I am trying to use a date function with arguements to assign a specific day
> to a form.  For example,  using the =date() function on the form would put in
[quoted text clipped - 5 lines]
> next sunday as soon as next monday arrives.  Thanks in advance!  I used to
> know how to do this but i simply cannot remember.
Douglas J. Steele - 28 May 2008 15:54 GMT
Or

DateAdd("d", (8 - Weekday(Date)) Mod 7, Date)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> This expression will return the Sunday of the week the date is in.  For
> Sunday, it will return the current date, for every other day, it returns
[quoted text clipped - 16 lines]
>> to
>> know how to do this but i simply cannot remember.
Klatuu - 28 May 2008 16:05 GMT
even better.
Signature

Dave Hargis, Microsoft Access MVP

> Or
>
[quoted text clipped - 20 lines]
> >> to
> >> know how to do this but i simply cannot remember.
 
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.