D
DrONDeN
I have a custom function as follows:
Public Function FilterIndex() As String
On Error Resume Next
Dim F1 As String
Dim F2 As String
Select Case Forms![Raw Data]![FI T1]
Case Is = "BLOCKED"
F1 = 0
Case Is = 0
F1 = 0
Case Is > 0
F1 = ((Left(Forms![Raw Data]![FI T1], 1) * 60) + (Right(Forms![Raw
Data]![FI T1], 2)))
End Select
Select Case Forms![Raw Data]![FI T2]
Case Is = "BLOCKED"
F2 = 0
Case Is = 0
F2 = 0
Case Is > 0
F2 = ((Left(Forms![Raw Data]![FI T2], 1) * 60) + (Right(Forms![Raw
Data]![FI T2], 2)))
End Select
Select Case F1 And F2
Case Is <> 0
FilterIndex = F2 - (F1 * 2)
Case Is = 0
FilterIndex = "BLOCKED"
End Select
End Function
It's aim is to turn a value entered into two controls from minutes and
seconds into seconds only and put the result in a new control. The
only problem is that the value returned by the function isn't
dynamically updated when the values are changed in the form. It only
seems to work when the form is closed then reopened. Is there
something I'm missing?
Thanks.
Public Function FilterIndex() As String
On Error Resume Next
Dim F1 As String
Dim F2 As String
Select Case Forms![Raw Data]![FI T1]
Case Is = "BLOCKED"
F1 = 0
Case Is = 0
F1 = 0
Case Is > 0
F1 = ((Left(Forms![Raw Data]![FI T1], 1) * 60) + (Right(Forms![Raw
Data]![FI T1], 2)))
End Select
Select Case Forms![Raw Data]![FI T2]
Case Is = "BLOCKED"
F2 = 0
Case Is = 0
F2 = 0
Case Is > 0
F2 = ((Left(Forms![Raw Data]![FI T2], 1) * 60) + (Right(Forms![Raw
Data]![FI T2], 2)))
End Select
Select Case F1 And F2
Case Is <> 0
FilterIndex = F2 - (F1 * 2)
Case Is = 0
FilterIndex = "BLOCKED"
End Select
End Function
It's aim is to turn a value entered into two controls from minutes and
seconds into seconds only and put the result in a new control. The
only problem is that the value returned by the function isn't
dynamically updated when the values are changed in the form. It only
seems to work when the form is closed then reopened. Is there
something I'm missing?
Thanks.