|
-
Oct 5th, 2000, 01:10 PM
#1
Thread Starter
Hyperactive Member
I have posted this before and didn't really explain myself at all well...so here goes.
I've tried various ways of doing this, still without luck, any suggestions would be cool.
I've got a project where upon I would like to specify the current tax week based on a text box containing a date.
For instance:-
My Text Box "txtTaxYearStart" contains a date manually entered by a user, which is the date their company starts their tax year.
Now from "txtTaxYearStart" I would like to be able to work out the current tax week.
If there are ways to do this I would be extremely grateful if you could share them with me.
A pre-empted enourmous thanks are due.
-
Oct 5th, 2000, 01:22 PM
#2
Look up the Format function. I think it is something like:
Code:
txtAbsWeek = Format(txtUserDate, "WW", vbMonday)
txtThisWeek = Format(Now, "WW", vbMonday)
if txtThisWeek - txtAbsWeek > 0
taxWeek = txtThisWeek - txtAbsWeek
else
taxWeek = 52 + txtThisWeek - txtAbsWeek
end if
-
Oct 5th, 2000, 03:47 PM
#3
Hyperactive Member
Check out the DateDiff Function should be something like this
Code:
txtDifference.Text = DateDiff("ww", txtTaxYearStart.Text, Date())
-
Oct 6th, 2000, 04:23 AM
#4
Thread Starter
Hyperactive Member
Thanks
Thanks for your replies.
I went for the following routiine:
code:--------------------------------------------------------------------------------
txtAbsWeek = Format(txtUserDate, "WW", vbMonday, vbFirstFullWeek)
txtThisWeek = Format(Now, "WW", vbMonday, vbFirstFullWeek)
if txtThisWeek - txtAbsWeek > 0
taxWeek = txtThisWeek - txtAbsWeek
else
taxWeek = 52 + txtThisWeek - txtAbsWeek
end if
Thanks RoyceWindsor1 for your help & also dcarlson 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|