Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > How do I loop w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 30435 of 31576
Post > Topic >>

How do I loop with this code

by troy_lee@[EMAIL PROTECTED] Jun 2, 2008 at 06:50 PM

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
 




 1 Posts in Topic:
How do I loop with this code
troy_lee@[EMAIL PROTECTED  2008-06-02 18:50:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 23:01:14 CST 2008.