Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If then else for Date Time Picker Question

Status
Not open for further replies.

Igawa29

MIS
Jan 28, 2010
99
US
So I am trying to make an IF statement that if the date logic stays as default (1/1/1900) then I want my program to do one thing, else do something else.

Code:
If StaffEnd_DT.Value.Equals("1/1/2000 12:00:00 AM") Or StaffEnd_DT.Value.Equals("1/1/1900 12:00:00 AM") Then

When I try to debug, it looks like it just blows through this logic. I have tried without the timestamp, longtime, shorttime..etc. I am at a lost on how to tell my program to understand the default date.
 
Thanks Skip! Worked like a charm.
Code:
        Dim jan012000 As New DateTime(2000, 1, 1)
        Dim jan011900 As New DateTime(1900, 1, 1)

       If StaffEnd_DT.Value.Equals(jan012000) Or StaffEnd_DT.Value.Equals(jan011900) Then

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top