Hi there, i hope someone can help me ASAP please.
I want to show 2 text boxes on a form which indicate next weeks starting date (next monday) and the week afters.
ie today is 14/12/2007 - i need 'textbox1' to automatically show "Mon 17/12/07" and 'textbox2' to automatically show "Mon 24/12/2007".
I'd appreciate anyones help on this one, thanks in advance, OllyJ
6 11587
hello you could default this by using this: - date() for textbox 1 and :
-
date()+10 in textbox 2
put these in the default value of the textboxes
lee123
Something like the following: -
DateAdd("d", 8 - Weekday(Date, vbMonday), Date)
-
DateAdd("d", 15 - Weekday(Date, vbMonday), Date)
-
Regards,
Fish
Thank you for your help.
Fish, your code helped tremendously.
The final code I used for "next Monday" and "the Monday after" (as it may help someone else out) is.....
"Next Monday": =DateAdd("d",8-Weekday(Date(),2),Date())
"the Monday after": =DateAdd("d",15-Weekday(Date(),2),Date())
Thanks again, OllyJ
Glad it has helped you.
Best regards,
Fish
NeoPa 32,556
Expert Mod 16PB
Something like the following: -
DateAdd("d", 8 - Weekday(Date, vbMonday), Date)
-
DateAdd("d", 15 - Weekday(Date, vbMonday), Date)
-
Regards,
Fish
A perfect answer Fish ;)
Thanks, NeoPa.
I just like such kind of solutions with "arithmetical" logic. ;)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Peter Pfeiffer |
last post by:
I've written several scripts that have "while" blocks which increment a
date by one day if the date does not match one of a group of dates.
However, sometimes it apparently steps out out the while...
|
by: netsurfer |
last post by:
Hi:
Have a question on making the date automatically filled in by what the
user enters in by the date at the top.
The date entered at the top would most likely be on a Wednesday then I
need...
|
by: Cillies |
last post by:
Hi,
I have created a simple update query, that updates the date everyday.
i.e. any date before today's date will be updated to todays date. I
have it running on an autoexec. macro
But I want...
|
by: planetthoughtful |
last post by:
Hi All,
I'm building some reports in Acc97 and using a custom calendar form to
allow users to pick dates with which to report.
I'm wondering if there's an easy way in code to be able to...
|
by: MLH |
last post by:
With a table of holidays and A97's date fn's - how best to count
weekends and holidays between two dates? My holiday table
has 4 fields. I will be adding records to it each year as info
becomes...
|
by: Joey Martin |
last post by:
I have a sql database and ASP pages.
How do I find out the DATES of THIS WEEKEND (fri-sun).
If today is Tuesday, I want to show information posted for THIS WEEKEND.
My table has a field...
|
by: Jim Carlock |
last post by:
(1) Does PHP provide any way to handle dates prior to 1980?
I know there's problems with Microsoft Windows NT and all Windows
NT operating systems will allow a date prior to 1980 to be placed...
|
by: cygfocus |
last post by:
Hello Everyone,
I am rookie here, I am trying to create a shipment calendar.
Basically I would like to auto-populate records based upon monthly (12X) , weekly(X52) or Two Times a month...
|
by: brechmos |
last post by:
Hi,
I have been using PHP the last while and in particular strtotime.
What I want to replicate is finding the second or fourth Monday of the
next month. In PHP with strtotime it is easy...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |