473,394 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Specific Dates - Next Monday

50
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
Dec 14 '07 #1
6 11587
lee123
556 512MB
hello you could default this by using this:

Expand|Select|Wrap|Line Numbers
  1. date()  for textbox 1 and :
  2. date()+10  in textbox 2
put these in the default value of the textboxes

lee123
Dec 14 '07 #2
FishVal
2,653 Expert 2GB
Something like the following:

Expand|Select|Wrap|Line Numbers
  1. DateAdd("d", 8 - Weekday(Date, vbMonday), Date)
  2. DateAdd("d", 15 - Weekday(Date, vbMonday), Date)
  3.  
Regards,
Fish
Dec 14 '07 #3
OllyJ
50
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
Dec 14 '07 #4
FishVal
2,653 Expert 2GB
Glad it has helped you.

Best regards,
Fish
Dec 14 '07 #5
NeoPa
32,556 Expert Mod 16PB
Something like the following:

Expand|Select|Wrap|Line Numbers
  1. DateAdd("d", 8 - Weekday(Date, vbMonday), Date)
  2. DateAdd("d", 15 - Weekday(Date, vbMonday), Date)
  3.  
Regards,
Fish
A perfect answer Fish ;)
Dec 14 '07 #6
FishVal
2,653 Expert 2GB
Thanks, NeoPa.
I just like such kind of solutions with "arithmetical" logic. ;)
Dec 14 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

11
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...
8
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...
2
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...
2
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...
2
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...
2
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...
2
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...
3
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
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,...
0
jinu1996
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...
0
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...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.