I have a form where i retrieve the start date and ending date from a table in access.
The start date and end date are both known as startdate and endate. Then i have another column which is status.
My code is like this:
sd = Me.startdate
ed = Me.enddate
DateValue (sd)
DateValue (ed)
If IsNull(sd And ed) Or (ed > Date) Then
Me.Text59 = "In use"
ElseIf (ed < Date) Then
Me.Text59 = "Free"
so basically what i wanted to do is, if the end date is earlier than today, the status will display it as Free. However, if the end date is later than today, the status will be in use. columns where the start date and end date are empty will be displayed as in use too.
My table's start date and end date are in date/time data type.
When the code runs, they only display "In use" when clearly some of my dates end earlier than today! Help please ):
Aucun commentaire:
Enregistrer un commentaire