Faulty Date Logic
Is the IF statement in the code at the top of p.292 correct?
The IF statement ...
If txtEndDate > txtStartDate Then
'Alert the user and Cancel the update
Cancel = MsgBox(Start Date must be before the End Date", _
vbInformation, "Data Validation Failure")
End If
is used to validate that the Start Date is before the End Date (or conversely, that the End Date is after the Start Date). The dates would be invalid if the Start Date were GREATER THAN the End Date.
In order for the code to work correctly, shouldn't the IF statement be changed to ...
If txtStartDate > txtEndDate Then
'Alert the user and Cancel the update
Cancel = MsgBox(Start Date must be before the End Date", _
vbInformation, "Data Validation Failure")
End If
Terry Waltz
__________________
Terry Waltz
|