A
Amit
MS Access 2K, Windows XP
====================
Hi,
I have a form with a text control txtDate and Control Source set to Date().
I also have a list with date in one of the columns.
I'm trying to compare these two dates in an IF statement in OnClick event of
a button on the form, and am getting opposite results than expected.
The value of date in the List is 9/13/2005 and the value of date for txtDate
is 9/14/2005.
When I do the following comparison:
If (Me.listCurrentUsers.Column(4, varItem) < Me.txtDate)
I get "False". When I use ">" instead, I get "True".
(varItem is for the selected row in the list)
I've checked the values of these controls using MsgBox, and the dates are
displayed correctly.
Am I missing something obvious here? Shouldn't my IF statement compute to
"True" since 9/13/2005 is less than 9/14/2005.
I did try enclosing the controls in "#" but that gave me compile error.
Would appreciate some help on this, as I have a feeling I'll be kicking
myself after someone points me in the right direction...
Thanks.
-Amit
====================
Hi,
I have a form with a text control txtDate and Control Source set to Date().
I also have a list with date in one of the columns.
I'm trying to compare these two dates in an IF statement in OnClick event of
a button on the form, and am getting opposite results than expected.
The value of date in the List is 9/13/2005 and the value of date for txtDate
is 9/14/2005.
When I do the following comparison:
If (Me.listCurrentUsers.Column(4, varItem) < Me.txtDate)
I get "False". When I use ">" instead, I get "True".
(varItem is for the selected row in the list)
I've checked the values of these controls using MsgBox, and the dates are
displayed correctly.
Am I missing something obvious here? Shouldn't my IF statement compute to
"True" since 9/13/2005 is less than 9/14/2005.
I did try enclosing the controls in "#" but that gave me compile error.
Would appreciate some help on this, as I have a feeling I'll be kicking
myself after someone points me in the right direction...
Thanks.
-Amit