473,379 Members | 1,330 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,379 software developers and data experts.

Do Loop Question

I have a form that asks for the month, the year, the number of weeks
in the month and the beginning date for the month.

I want to be able to:

Number the weeks (e.g. 1, 2,3, etc.)
Assign a beginning date and an ending date for each week
Loop this for the number of weeks as input on the form
Transfer each week's number with corresponding beginning and ending
dates to a table

Thanks for the help in advance.

Troy Lee
Jun 30 '08 #1
3 2028
tr******@comcast.net wrote:
I have a form that asks for the month, the year, the number of weeks
in the month and the beginning date for the month.

I want to be able to:

Number the weeks (e.g. 1, 2,3, etc.)
Assign a beginning date and an ending date for each week
Loop this for the number of weeks as input on the form
Transfer each week's number with corresponding beginning and ending
dates to a table

Thanks for the help in advance.

Troy Lee
There's some missing elements in your problem/question. Look at the
Format() function in help. You can set/determine the first day of a
week with one argument.
vbUseSystem 0 Use NLS API setting.
VbSunday 1 Sunday (default)
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday

You can also set what indicates the first week of the year.
vbUseSystem 0 Use NLS API setting.
vbFirstJan1 1 Start with week in which January 1 occurs (default).
vbFirstFourDays 2 Start with the first week that has at least four days
in the year.
vbFirstFullWeek 3 Start with the first full week of the year.
Here's some examples from the debug window to get the week number.
? format(#1/1/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFourDays)
1
? format(#1/6/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFourDays)
2
? format(#1/1/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFullWeek)
52
? format(#1/6/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFullWeek)
1
? format(#1/1/2008#,"ww",vbUseSystemDayOfWeek,vbFirstJan1)
1
? format(#1/6/2008#,"ww",vbUseSystemDayOfWeek,vbFirstJan1)
2
? format(#1/1/2008#,"ww",vbUseSystemDayOfWeek,vbUseSystem)
1
? format(#1/6/2008#,"ww",vbUseSystemDayOfWeek,vbUseSystem)
2
? format(#12/31/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFourDays)
53
? format(#12/31/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFullWeek)
52
? format(#12/31/2008#,"ww",vbUseSystemDayOfWeek,vbFirstJan1)
53

So it's possible to get the week number from a date, the question
is...when does a week start for you?

Bosa Noga
http://www.youtube.com/watch?v=h73T4gLyZNw
Jun 30 '08 #2
On Jun 30, 4:02 pm, Salad <o...@vinegar.comwrote:
troy_...@comcast.net wrote:
I have a form that asks for the month, the year, the number of weeks
in the month and the beginning date for the month.
I want to be able to:
Number the weeks (e.g. 1, 2,3, etc.)
Assign a beginning date and an ending date for each week
Loop this for the number of weeks as input on the form
Transfer each week's number with corresponding beginning and ending
dates to a table
Thanks for the help in advance.
Troy Lee

There's some missing elements in your problem/question. Look at the
Format() function in help. You can set/determine the first day of a
week with one argument.
vbUseSystem 0 Use NLS API setting.
VbSunday 1 Sunday (default)
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday

You can also set what indicates the first week of the year.
vbUseSystem 0 Use NLS API setting.
vbFirstJan1 1 Start with week in which January 1 occurs (default).
vbFirstFourDays 2 Start with the first week that has at least four days
in the year.
vbFirstFullWeek 3 Start with the first full week of the year.

Here's some examples from the debug window to get the week number.
? format(#1/1/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFourDays)
1
? format(#1/6/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFourDays)
2
? format(#1/1/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFullWeek)
52
? format(#1/6/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFullWeek)
1
? format(#1/1/2008#,"ww",vbUseSystemDayOfWeek,vbFirstJan1)
1
? format(#1/6/2008#,"ww",vbUseSystemDayOfWeek,vbFirstJan1)
2
? format(#1/1/2008#,"ww",vbUseSystemDayOfWeek,vbUseSystem)
1
? format(#1/6/2008#,"ww",vbUseSystemDayOfWeek,vbUseSystem)
2
? format(#12/31/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFourDays)
53
? format(#12/31/2008#,"ww",vbUseSystemDayOfWeek,vbFirstFullWeek)
52
? format(#12/31/2008#,"ww",vbUseSystemDayOfWeek,vbFirstJan1)
53

So it's possible to get the week number from a date, the question
is...when does a week start for you?

Bosa Nogahttp://www.youtube.com/watch?v=h73T4gLyZNw
My week always starts on a Monday and ends on Sunday. (Sorry, that was
important information.)

Our corporate calendar is a little skewed from the real calendar. My
thought was to circumvent this nuance by setting up a docket of weekly
reports categorized by their respective months. Since some corporate
months can be four or five weeks, I wanted to be able to set up the
month's weeks right at the beginning of the month by selecting a
beginning date and the number of weeks in the month. From there it
should just be a math problem, right?

What I really have is a major problem and since you have been so kind
in your responses, I might as well tell you. Our department (newly
created 8 months ago) keeps a "scorecard" of our activities. This is
done in Excel. I am trying to mimic, in essence, the Excel scorecard
in Access because all the answers are in the database. My problem is
that this scorecard is kept as a monthly summary, with each week's
data manually entered and eventually aggregated in various ways on
other worksheets.

Most of this reporting can be done through queries alone. However, I
have this data I need to capture at the beginning of every week. That
is our planned ships for the week. All of these units have been tagged
with a special code number in the database making it easy to find
them. The problem is is that this information must appear on what is
last week's scorecard, which is tallied at the same time, because this
is our plans for the new week. New week data and last week data has
got me stumped.

So, on Monday morning I need to be able to capture our planned ships
for this new week, while capturing last week's data. If I don't take a
snapshot of these units on Monday, there is no way to determine what
our beginning priority list looked like by the end of the week as
these units' status will change (customer needs to send a PO for
repair, unit has shipped, etc.). This is why I wanted to set up a
table defining my months and weeks- so I could store this data,
effectively taking a snapshot in time of the units' status.

None of this may make much sense but this is a problem I have put a
lot of thought of into, and can't seem to really decide the best way
to pull it off.

Troy
Jul 1 '08 #3
On Jun 30, 3:14*pm, troy_...@comcast.net wrote:
I have a form that asks for the month, the year, the number of weeks
in the month and the beginning date for the month.

I want to be able to:

Number the weeks (e.g. 1, 2,3, etc.)
Assign a beginning date and an ending date for each week
Loop this for the number of weeks as input on the form
Transfer each week's number with corresponding beginning and ending
dates to a table

Thanks for the help in advance.

Troy Lee
Maybe:

http://groups.google.com/group/micro...77af0e1fa201c4

James A. Fortune
CD********@FortuneJames.com
Jul 2 '08 #4

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

Similar topics

2
by: John | last post by:
Hi there folks... Just wondering if someone can help a newbie to VB!? I'm running some stuff in a For loop. Each time the loop runs it makes a change to a value which it should display in a...
24
by: Tweaxor | last post by:
This has been puzzling me all this week. This is actually a homework assignment from last semesmter. But the teacher wouldn't tell us why certain things didn't work, but it didn't just work. My...
14
by: morpheus | last post by:
Hi Group, May I ask the following? for (i=0; (c=getchar()) != EOF && c != '\n'; ++i) line=c; What I am finding is that when c == '\n' is true, the loop is terminated but i is still...
4
by: bruce | last post by:
hi.. basic foor/loop question.. i can do: for a in foo print a if i want to do something like
11
by: logicode | last post by:
I need a loop that can be put in 3 instances. I am not sure which loop I can find and I dont want to use a switch statement so can you help? I Already know the code just the loop for it. ...
10
by: Milo Daemon | last post by:
Hi, i am extremely new to python and i've been following a tutorial about learning to programm with python. After reading through the tutorial and answering the questions given by it i findally came...
11
by: SM | last post by:
I have a couple of arrays that represent different categories. One array per category. The arrays contain names of photos. The arrays look like this: $cat_1 = array('moonlight.jpg'',...
2
by: takayuki | last post by:
Hi everyone, I'm studying python via the excellent "how to think like a python programmer" book by Allen Downey. Noob question follows... I have a txt file (animals.txt) which contains the...
7
by: gordon | last post by:
is it possible to send a message to the gui instance while the Tk event loop is running?I mean after i create a gui object like root=Tk() mygui=SomeUI(root) and call root.mainloop() can i...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.