How to create detail date

H

Hunt

Dear developer friends,

i want to create a date in an Word 2007 Textbox, but not a normal date :)

txtdate.text = date, already have this function and it works, but i want to
change the date to the next day's date if the clock pasts 6 pm. (textbox
today before 6 pm = 24-Aug-2009! txtbox today after 6 pm = 25-Aug-2009!)

"If ..." i do not know how to start this IF function for this date thing :(

thanks in advance and hope that there is a solution for my problem ^^
 
H

H. Druss

Hunt said:
Dear developer friends,

i want to create a date in an Word 2007 Textbox, but not a normal date :)

txtdate.text = date, already have this function and it works, but i want
to
change the date to the next day's date if the clock pasts 6 pm. (textbox
today before 6 pm = 24-Aug-2009! txtbox today after 6 pm = 25-Aug-2009!)

"If ..." i do not know how to start this IF function for this date thing
:(

thanks in advance and hope that there is a solution for my problem ^^

Hi Hunt
Check out the Time() function

air code:

If Time > #6:00:00 PM# Then
txtDate=Date+1
Else
txtDate=Date
End If

Good luck
Harold
 
H

Hunt

H. Druss said:
Hi Hunt
Check out the Time() function

air code:

If Time > #6:00:00 PM# Then
txtDate=Date+1
Else
txtDate=Date
End If

Good luck
Harold

Thanks Harold, this works great! Is there any function to change the time
for different days, for Monday - Thursday after 6 pm and for Friday after 4
pm?

Forgot to mention this in my first post.
 
G

Graham Mayor

You can set the time separately for any day of the week

txtDate = Date
Select Case Weekday(Date)
Case Is = 2, 3, 4, 5 'Monday to Thursday
If Time > #6:00:00 PM# Then
txtDate = Date + 1
End If
Case Is = 6 'Friday
If Time > #4:00:00 PM# Then
txtDate = Date + 1
End If
Case Else 'Saturday & Sunday
End Select


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
H

Hunt

OMG, wonderful, thanks for this great help.

I will use this platform now for all of my questions, its much faster than
looking for info via google or any other communities.

THANKS THANKS THANKS <3
 
D

Doug Robbins - Word MVP

I would suggest that you do not give up on Google as if you phrase your
search appropriately, you may find the answer to your question immediately
rather than having to wait for one of your peers to respond to a newsgroup
post.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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