Week number of the current Month

Edwin

Registered User.
Local time
Today, 16:49
Joined
Dec 27, 2000
Messages
19
Hello everyone.

I would like to ask for help on my current problem.

I need to input a date on a text box and another text box say txtweeknumber should determine the week number the date falls on the current month.

for example:

May 1, 2005 should fall on week 1 and txtboxweeknumber should say Week 1
May 9, 2005 should fall on week 2 and txtboxweeknumber should say Week 2
May 17, 2005 should fall on week 3 and txtboxweeknumber should say Week 3
May 25, 2005 should fall on week 4 and txtboxweeknumber should say Week 4
May 30, 2005 should fall on week 5 and txtboxweeknumber should say Week 5

Same goes for all months.
Is there a function to determine which week number of the current month the input date falls?

Please help.

Thanks,

Edwin
 
Week Number

Try this code in the After Update Event of the Date TextBox or the
On Click Event of a Command Button:

******
Dim t_Day As Double
t_Day = Day(InputDate)

Select Case t_Day
Case 1, 2, 3, 4, 5, 6, 7, 8
Me.txtboxweeknumber = 1
Case 9, 10, 11, 12, 13, 14, 15, 16
Me.txtboxweeknumber = 2
Case 17, 18, 19, 20, 21, 22, 23, 24
Me.txtboxweeknumber = 3
Case 25, 26, 27, 28, 29
Me.txtboxweeknumber = 4
Case 30, 31
Me.txtboxweeknumber = 5
End Select
******

Replace 'Inputdate' with the name of the box that holds the Date.
 
thank you very much
 

Users who are viewing this thread

Back
Top Bottom