Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old June 27th, 2008, 08:26 PM
troy_lee@comcast.net
Guest
 
Posts: n/a
Default 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
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles