473,480 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How do I loop with this code

Here's what I have so far...

Private Sub Text4_AfterUpdate()
Dim dtmWeek1BegDate As Long
Dim dtmWeek1EndDate As Long
Dim intWeekNumber As Integer

' Text4 is the beginning day of the month which will equal the
first day of the first week.
dtmWeek1BegDate = Me!Text4
Me!Text8 = dtmWeek1BegDate

dtmWeek1EndDate = DateAdd("d", 6, dtmWeek1BegDate)
Me!Text10 = dtmWeek1EndDate

intWeekNumber = 1
Text6 = "Week " & intWeekNumber
End Sub

The user will start a new form each month. They are asked to provide
the month name and year, the beginning day of the month and how many
weeks will be in this month (4 or 5 are the only acceptable choices).

I want to loop this code so that the correct number of weeks are
created for the month as put in by the user . The rest of the weeks'
variables are not shown, but I will need a beginning and end date for
each week (these will provide parameters for my queries). In addition,
I need to increment the intWeekNumber variable so that it counts up to
and returns the sequential number for the number of weeks required by
the user.

I hope this makes sense. Thanks for the help in advance.

Troy
Jun 27 '08 #1
0 1052

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2910
by: Charles Alexander | last post by:
Hello I am new to php & MySQL - I am trying to retrieve some records from a MySQL table and redisplay them. The data in list form looks like this: Sample_ID Marker_ID Variation ...
47
12010
by: Mountain Bikn' Guy | last post by:
Take some standard code such as shown below. It simply loops to add up a series of terms and it produces the correct result. // sum numbers with a loop public int DoSumLooping(int iterations) {...
2
3379
by: Sandy | last post by:
See line beginning with WHAT GOES HERE ..... Do Until ......................... Code .... .... If .............. Then WHAT GOES HERE TO JUMP TO THE END OF THE LOOP AND LOOP AGAIN End If...
2
2656
by: Alex | last post by:
Compiler - Borland C++ 5.6.4 for Win32 Copyright (c) 1993, 2002 Borland Linker - Turbo Incremental Link 5.65 Copyright (c) 1997-2002 Borland Platform - Win32 (XP) Quite by accident I stumbled...
22
2190
by: Jan Richter | last post by:
Hi there, the Code below shows DJBs own implementation of strlen (str_len): unsigned int str_len(char *s) { register char *t; t = s; for (;;) { if (!*t) return t - s; ++t;
63
3153
by: Aaron Ackerman | last post by:
What is the sytax for exiting a for loop in C#?
15
2650
by: Mike Lansdaal | last post by:
I came across a reference on a web site (http://www.personalmicrocosms.com/html/dotnettips.html#richtextbox_lines ) that said to speed up access to a rich text box's lines that you needed to use a...
8
1664
by: Microsoft | last post by:
I have the following loop the length contains somewhere around 1000+ items: For elemIndex = 0 To len - 1 elem = CType(doc.all.item(elemIndex), mshtml.IHTMLElement) If elem.tagName = "A" Then If...
16
3481
by: Claudio Grondi | last post by:
Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of...
2
19285
ADezii
by: ADezii | last post by:
If you are executing a code segment for a fixed number of iterations, always use a For...Next Loop instead of a Do...Loop, since it is significantly faster. Each pass through a Do...Loop that...
0
7051
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6915
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7054
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,...
1
6750
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...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.