ramblinwreck
Registered User.
- Local time
- Today, 15:59
- Joined
- Apr 13, 2007
- Messages
- 28
I have code that is activated by a command button. One of the first things the code does is check the date that a user has just input and in the specific code below, it makes sure the date is not a date in the future.
When this code executes however, the if then below is determined to be "true" whereas it should have determined it to be false.
The user enters a specific date of 6/09/2007, the DATE function tells the program that today's date is 6/10/2007 and then this code executes:
As I said above, when the if statement is evaluated, it deems that 6/9/2007 is greater than 6/10/2007 and the wrong lines of code are subsequently executed.
Hoping you can help me solve this problem.
When this code executes however, the if then below is determined to be "true" whereas it should have determined it to be false.
The user enters a specific date of 6/09/2007, the DATE function tells the program that today's date is 6/10/2007 and then this code executes:
Code:
Continue:
If txtDate.Text > Date Then 'can't enter a date that's in the future.
MsgBox "you have entered a date in the future. Check your date."
txtDate.Text = Date
txtDate.SetFocus
Calendar1.Value = Date
Exit Sub
End If
As I said above, when the if statement is evaluated, it deems that 6/9/2007 is greater than 6/10/2007 and the wrong lines of code are subsequently executed.
Hoping you can help me solve this problem.