borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Gracefully Handling Multiple Users Accessing the Same File Simultaneously) New Topic New Poll Post Reply
AndreaVB Forum : VB General : now/date code question
Poster Message
Martin
Level: Trainee

Registered: 08-02-2008
Posts: 1

icon now/date code question

Friends,

Is there a way to use a specific date with the code i am using below?

If (Weekday(Now) = vbThursday) Then

cheers!
Martin or just M

08-02-2008 at 04:27 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1000
icon Re: now/date code question

Hi,
yep, here's some examples:


dim d as date

d = now

if isweekday(d) = vbThursday then
   msgbox "Thursday!"
end if
if isweekday(cdate("1 jan 2008")) = vbThursday then
  msgbox "Thursday too!"
end if

if isdate(me.textbox1.text) then
  if isweekday(cdate(me.textbox1.text)) = vbThursday then
    msgbox "Thursday too (but the user keyed it into a textbox!"
  end if
end if


Hope this helps
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

08-02-2008 at 09:12 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : now/date code question
Next Topic (Gracefully Handling Multiple Users Accessing the Same File Simultaneously) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder