Select Case troubles...

Myriad_Rocker

Questioning Reality
Local time
Today, 18:21
Joined
Mar 26, 2004
Messages
166
This won't work for some reason. I know the date going into it is 9/1

Code:
ElseIf thedate.Month = 9 And thedate.DayOfWeek = DayOfWeek.Monday Then
            Select Case thedate.Day
                Case 1 To 7
                    thedate.AddDays(1)
            End Select
 
How about including a little more of the surrounding code so we can tell what each element is? What is thedate.? How about DayOfWeek.Monday?
 
How about including a little more of the surrounding code so we can tell what each element is? What is thedate.? How about DayOfWeek.Monday?

thedate is simply a variable that has the date from a textbox in it. The textbox value is being cast as a date type and put into thedate. I know that the value of thedate is 9/1 when going into that section of code because I stepped through it.

DayOfWeek.Monday is just the intellisense stuff that comes up. It's a aspx vb.net thing, I guess.
 
I got it. One small difference.

Code:
ElseIf thedate.Month = 9 And thedate.DayOfWeek = DayOfWeek.Monday Then
            Select Case thedate.Day
                Case 1 To 7
                    thedate = thedate.AddDays(1)
            End Select
 
Excellent! Thanks for popsting back with your success.
 
Would you please be so kind as to hilite the difference? ... I can not see a difference between the two code blocks you posted :eek: ...
 
Would you please be so kind as to hilite the difference? ... I can not see a difference between the two code blocks you posted :eek: ...

Brent:

Instead of

thedate.AddDays(1)

He changed to:
thedate = thedate.AddDays(1)
 
Bob ...

Thanks buddy ... Its plain as day now!!! .... <dazed and confused> ... :D
 

Users who are viewing this thread

Back
Top Bottom