NotSoRandomOne
Registered User.
- Local time
- Yesterday, 19:22
- Joined
- Sep 15, 2009
- Messages
- 51
The problem I'm having is that dates aren't comparing as I expect them to. In the 'After Update' event of a text box (formatted as a short date) named 'DateBox', I'm trying to update a combo box's 'RowSource' so the user only sees the appropriate information per the other information on the form.
The code:
'CertEnd' is a short date in the original database. Unfortunately, the comparison statement doesn't update the row source correctly: all of the Therapy Orders are still listed in the combo box, even if their CertEnd falls before theDate. If I change it to a '<=' comparison, no therapy orders are listed.
After two hours, this has me baffled.
Thanks,
David
The code:
Code:
Dim theDate As Date
... (null check...)
theDate = DateBox.Value
...
TherapyOrderCombo.RowSource = "SELECT TherapyOrdersQuery.ID, TherapyOrdersQuery.TherapyOrder" _
& " FROM TherapyOrdersQuery WHERE Therapy = " & TherapyTypeEnum.PhysicalTherapy _
& " and TherapyOrdersQuery.CertEnd >= " & theDate
After two hours, this has me baffled.
Thanks,
David