|
-
Aug 31st, 2000, 08:22 AM
#1
Thread Starter
Lively Member
Hi folks!
I need to display a particular text box depending on the day.
ie
If it's Mon, Tues, Wed or Thurs - display txt1
If it's Friday - display txt2
How could I go about doing this?
Cheers
Simon
-
Aug 31st, 2000, 08:30 AM
#2
Lively Member
Try this:
Sub form_load()
Dim a As String
a = UCase(Format(Day(Now), "dddd"))
Select Case a
Case "Monday"
txt1.Visible = True
End Select
End sub
-
Aug 31st, 2000, 08:31 AM
#3
Try the following:
Code:
Select Case Format(Date, "dddd")
Case "Sunday"
'It's Sunday
Case "Monday"
'It's Monday
Case "Tuesday"
'It's Tuesday
Case "Wednesday"
'It's Wednesday
Case "Thursday"
'It's Thursday
Case "Firday"
'It's Firday
Case "Saturday"
'It's Saturday
End Select
-
Aug 31st, 2000, 08:33 AM
#4
Fanatic Member
Code:
Select Case Weekday(Now)
'mon - thu
Case 2 To 5
Text1.Visible = True
'friday
Case 6
Text2.Visible = True
Case Else
'else
End Select
Oh well, as usual beatean to it 
look like i am the one guilty of posting after the answer.
Iain, thats with an i by the way!
-
Aug 31st, 2000, 08:35 AM
#5
Use the Weekday function:
Code:
Dim intWeekday As Integer
Dim dtmTestDate As Date
intWeekday = Weekday(dtmTestDate)
Select Case intWeekday
Case Is vbMonday To vbThursday
Text1.Text = "Monday thru Thursday message"
Case vbFriday
Text1.Text = "Friday message"
Case Else
' whatever
End Select
"It's cold gin time again ..."
Check out my website here.
-
Aug 31st, 2000, 08:44 AM
#6
Thread Starter
Lively Member
Waheey!
Thanks guys for probably the speediest replies on record 
Cheers
Simon
-
Aug 31st, 2000, 08:53 AM
#7
_______
<?>
I can't get into your other post for some reason so I'll give you my answer to your question on datediff here:
'my guess (I'm not sure where it starts counting)
'thurs or Mon...the stuff is hard reading..
'assuming there are 5 working days in each week
Dim nDateDiff As Variant
nDateDiff = DateDiff("w", Date, "20/10/2000", vbMonday) * 5
x = nDateDiff
MsgBox x
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 31st, 2000, 09:00 AM
#8
Thread Starter
Lively Member
Thanks! That's great!
Cheers
Simon
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
|