/gustav
Public Function DateThrough(ClientIntroIn As Variant, ClientTermIn As Variant, SMMTIntroIn As Variant, SmmtTermIn As Variant) As Boolean
Dim OutputLogic As Boolean
Dim SmmtIntroGiven As Boolean
Dim SmmtTermGiven As Boolean
Dim ClientIntroGiven As Boolean
Dim ClientTermGiven As Boolean
Dim dateCheck As Boolean
Dim BinaryString As String
Dim dateSmmtIntroCheck As Boolean
Dim dateSmmtTermCheck As Boolean
Dim dateClientIntroCheck As Boolean
Dim dateClientTermCheck As Boolean
'çheck if date
dateSmmtIntroCheck = IsDate(CDate(Nz(ClientIntroIn, 0)))
dateSmmtTermCheck = IsDate(CDate(ClientTermIn))
dateClientIntroCheck = IsDate(CDate(SMMTIntroIn))
dateClientTermCheck = IsDate(CDate(SmmtTermIn))
'çheck if null values or non date values passed
If (IsNull(ClientIntroIn) = True) Or (dateClientIntroCheck = False) Then
ClientIntroGiven = False
BinaryString = "0"
Else
ClientIntroGiven = True
BinaryString = "1"
End If
If (IsNull(ClientTermIn) = True) Or (dateClientTermCheck = False) Then
ClientTermGiven = False
BinaryString = BinaryString & "0"
Else
ClientTermGiven = True
BinaryString = BinaryString & "1"
End If
If (IsNull(SMMTIntroIn) = True) Or (dateSmmtIntroCheck = False) Then
SmmtIntroGiven = False
BinaryString = BinaryString & "0"
Else
SmmtIntroGiven = True
BinaryString = BinaryString & "1"
End If
If (IsNull(SmmtTermIn) = True) Or (dateSmmtTermCheck = False) Then
SmmtTermGiven = False
BinaryString = BinaryString & "0"
Else
SmmtTermGiven = True
BinaryString = BinaryString & "1"
End If
'take relevant action
Select Case BinaryString
Case "0000": OutputLogic = True
Case "0001": OutputLogic = True
Case "0010": OutputLogic = True
Case "0011": OutputLogic = True
Case "0100": OutputLogic = True
Case "0101"
OutputLogic = DateInvariance(ClientTermIn, SmmtTermIn, ReturnTermcount())
Case "0110"
Case "0111"
Case "1000": OutputLogic = True
Case "1001"
Case "1010"
Case "1011"
Case "1100": OutputLogic = True
Case "1101"
Case "1110"
Case "1111"
End Select
DateThrough = OutputLogic
End Function
Public Function DateThrough(ClientIntroIn As Variant, ClientTermIn As Variant, SMMTIntroIn As Variant, SmmtTermIn As Variant) As Boolean
Dim OutputLogic As Boolean
Dim SmmtIntroGiven As Boolean
Dim SmmtTermGiven As Boolean
Dim ClientIntroGiven As Boolean
Dim ClientTermGiven As Boolean
Dim dateCheck As Boolean
Dim BinaryString As String
Dim dateSmmtIntroCheck As Boolean
Dim dateSmmtTermCheck As Boolean
Dim dateClientIntroCheck As Boolean
Dim dateClientTermCheck As Boolean
'çheck if date
dateSmmtIntroCheck = IsDate(ClientIntroIn)
dateSmmtTermCheck = IsDate(ClientTermIn)
dateClientIntroCheck = IsDate(SMMTIntroIn)
dateClientTermCheck = IsDate(SmmtTermIn)
'çheck if null values or non date values passed
If (IsNull(ClientIntroIn) = True) Or (dateClientIntroCheck = False) Then
ClientIntroGiven = False
BinaryString = "0"
Else
ClientIntroGiven = True
BinaryString = "1"
End If
If (IsNull(ClientTermIn) = True) Or (dateClientTermCheck = False) Then
ClientTermGiven = False
BinaryString = BinaryString & "0"
Else
ClientTermGiven = True
BinaryString = BinaryString & "1"
End If
If (IsNull(SMMTIntroIn) = True) Or (dateSmmtIntroCheck = False) Then
SmmtIntroGiven = False
BinaryString = BinaryString & "0"
Else
SmmtIntroGiven = True
BinaryString = BinaryString & "1"
End If
If (IsNull(SmmtTermIn) = True) Or (dateSmmtTermCheck = False) Then
SmmtTermGiven = False
BinaryString = BinaryString & "0"
Else
SmmtTermGiven = True
BinaryString = BinaryString & "1"
End If
'take relevant action
Select Case BinaryString
Case "0000": OutputLogic = True
Case "0001": OutputLogic = True
Case "0010": OutputLogic = True
Case "0011": OutputLogic = True
Case "0100": OutputLogic = True
Case "0101"
OutputLogic = DateInvariance(ClientTermIn, SmmtTermIn, ReturnTermcount())
Case "0110"
Case "0111"
Case "1000": OutputLogic = True
Case "1001"
Case "1010"
Case "1011"
Case "1100": OutputLogic = True
Case "1101"
Case "1110"
Case "1111"
End Select
DateThrough = OutputLogic
End Function
If IsDate(Me![txtToDate].Value) = True Then
dteToDate = CDate(Me![txtToDate].Value)
End If
Public Function DateThrough(ClientIntroIn As Variant, ClientTermIn As Variant, SMMTIntroIn As Variant, SmmtTermIn As Variant) As Boolean
Dim OutputLogic As Boolean
Dim BinaryString As String
Dim ClientIntrodteToDate As Date
Dim ClientTermdteToDate As Date
Dim SmmtIntrodteToDate As Date
Dim SmmtTermdteToDate As Date
'çheck if null values or non date values passed
If IsDate(ClientIntroIn) = True Then
ClientIntrodteToDate = CDate(ClientIntroIn)
BinaryString = "1"
Else
BinaryString = "0"
End If
If IsDate(ClientTermIn) = True Then
ClientTermdteToDate = CDate(ClientTermIn)
BinaryString = BinaryString & "1"
Else
BinaryString = BinaryString & "0"
End If
If IsDate(SMMTIntroIn) = True Then
SmmtIntrodteToDate = CDate(SMMTIntroIn)
BinaryString = BinaryString & "1"
Else
BinaryString = BinaryString & "0"
End If
If IsDate(SmmtTermIn) = True Then
SmmtTermdteToDate = CDate(SmmtTermIn)
BinaryString = BinaryString & "1"
Else
BinaryString = BinaryString & "0"
End If
'take relevant action
Select Case BinaryString
Case "0000": OutputLogic = True
Case "0001": OutputLogic = True
Case "0010": OutputLogic = True
Case "0011": OutputLogic = True
Case "0100": OutputLogic = True
Case "0101": OutputLogic = DateInvariance(ClientTermdteToDate, SmmtTermdteToDate, ReturnTermcount())
Case "0110"
Case "0111"
Case "1000": OutputLogic = True
Case "1001"
Case "1010"
Case "1011"
Case "1100": OutputLogic = True
Case "1101"
Case "1110"
Case "1111"
End Select
DateThrough = OutputLogic
End Function
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!