by Kevin D. Sandal (2 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 9th April 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Determines if a variant is equivalent to either True or False.
On Error Resume Next
Dim blnReturnVal As Boolean
If IsNumeric(vntValue) Then
blnReturnVal = (vntValue = True)
Else
If Not IsDate(vntValue) Then
Dim strText As String
strText = Trim$(UCase$(vntValue))
If strText = "TRUE" Or strText = "1" Or strText = "YES" Then
blnReturnVal = True
End If
Else
blnReturnVal = (CInt(vntValue) = True)
End If
End If
TrueOrFalse = blnReturnVal
End Function