nuttychick
Registered User.
- Local time
- Today, 17:08
- Joined
- Jan 16, 2004
- Messages
- 84
Hi, I have some VB on a form and part of its job is to display a message if certain criteria is met, the code itself runs but doesn't appear to be calculating correctly....I have highlighted in red the section that is being missed, because the app is calculating the result as false
I have used the debug window to confirm what the value is of each object.
My knowledge of dates tell me that 08/05/06 is indeed less than or equal to 10/05/06, so why does it come back as false?
The object Forms![Study_Main]![ITSuppPropDate] is a list box showing dates, using itemdata to return the first entry in the list box, the object is formatted as shortdate...
Where am I going wrong..??
Oh and if I make Forms![Study_Main]![ITSuppPropDate].ItemData(0) >= Date it will run the code!? but it doesn't seem to be being consistant..
HELP!! driving me barmy
Code:
If Forms![Study_Main]![study_type_id] = 26 Then 'And txtCurrentUserRole = "Proposal Manager" Then
If Not IsNull(Forms![Study_Main]![ITSuppPropDate].ItemData(0)) Then
[COLOR="Red"]If Forms![Study_Main]![ITSuppPropDate].ItemData(0) <= Date[/COLOR] Then
If Forms![Study_Main]![study_status_hist_subform]![status_type] <> "Closed" Then
If Forms![Study_Main]![study_status_hist_subform]![status_type] <> "Commercial Cover Received" Then
MsgBox "The IT Supplier Proposal due date on this study has been reached. If you are the Bid Manager, please can you ensure the status is updated"
Else
End If
End If
End If
End If
End If
I have used the debug window to confirm what the value is of each object.
My knowledge of dates tell me that 08/05/06 is indeed less than or equal to 10/05/06, so why does it come back as false?
Code:
?date
10/05/06
?Forms![Study_Main]![ITSuppPropDate].ItemData(0)
08/05/06
?Forms![Study_Main]![ITSuppPropDate].ItemData(0) <= Date
False
The object Forms![Study_Main]![ITSuppPropDate] is a list box showing dates, using itemdata to return the first entry in the list box, the object is formatted as shortdate...
Where am I going wrong..??
Oh and if I make Forms![Study_Main]![ITSuppPropDate].ItemData(0) >= Date it will run the code!? but it doesn't seem to be being consistant..
HELP!! driving me barmy