number of week (1-52)

J

Jan Eikeland

hello,
Im using Access97.

Need to assign number of week in a etikette or text box.

Read in help-file about this := Format(Now(); "ww")

But this does not pop up weeknumber, only ww

Can somebody help me with this ?

thank You
jan
 
J

Jan Eikeland

ive found this VBA function,
Function WEEKNR(InputDate As Long) As Integer
Dim A As Integer, B As Integer, C As Long, D As Integer
WEEKNR = 0
If InputDate < 1 Then Exit Function
A = Weekday(InputDate, vbSunday)
B = Year(InputDate + ((8 - A) Mod 7) - 3)
C = DateSerial(B, 1, 1)
D = (Weekday(C, vbSunday) + 1) Mod 7
WEEKNR = Int((InputDate - C - 3 + D) / 7) + 1
End Function
Could somebody tell me how to implement it in Access?
I havent any VBA programming tool.

tks jan

thank You
 
J

Jan Eikeland

thank You for answer.
Im a newbie, as u may have noticed :)

First : Is this expression supposed to return the value of weeknumber in
,lets say a textbox?
The link under doesnt work.
thank You
reg Jan
 
J

Jan Eikeland

I followed the link.
Date and Now function works seperately.
As I try to set expression into controlsource field of textboks, application
changes it by adding 2 pcs of semicolons at each side of ww

thank You.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top