I'm having trouble closing an If statement.
I wrote a function to change short time to minutes.
Function TimeToMin(MyTime)
TimeToMin = CInt(CDbl(MyTime) * 24 * 60)
End function
This works fine when there is a short time in the field.
However, some of my time fields in the table are NULL and i'm getting an error.
I changed the function to use an If then else, but i'm having trouble. What is wrong here?
Function TimeToMin(MyTime)
If MyTime Is Null Then TimeToMin = 0
Else
TimeToMin = CInt(CDbl(MyTime) * 24 * 60)
End If
End Function
I wrote a function to change short time to minutes.
Function TimeToMin(MyTime)
TimeToMin = CInt(CDbl(MyTime) * 24 * 60)
End function
This works fine when there is a short time in the field.
However, some of my time fields in the table are NULL and i'm getting an error.
I changed the function to use an If then else, but i'm having trouble. What is wrong here?
Function TimeToMin(MyTime)
If MyTime Is Null Then TimeToMin = 0
Else
TimeToMin = CInt(CDbl(MyTime) * 24 * 60)
End If
End Function