Visual basic code that i pass to crystal reports. when i pass the stroption = "CLOSED" i get the error message stating run time error '20515'
If IsDate(txtStartDate) And IsDate(txtEndDate) Then
dteReturnValue = txtStartDate
dteReturnValue2 = txtEndDate
strControl = Format$(dteReturnValue, "yyyymmdd"
strControl2 = Format$(dteReturnValue2, "yyyymmdd"
strFormula = "{CAO.DateReceived} in Date(" & Left(strControl, 4) & "," & Mid(strControl, 5, 2) & "," & Right(strControl, 2) & " to Date(" & Left(strControl2, 4) & ", " & Mid(strControl2, 5, 2) & "," & Right(strControl2, 2) & "" & " and {CAO.Assignee} = '" & (cboAssignee.Text) & "'"
'OPEN ITEMS ONLY
If optOpen(0).Value = True Then
strOption = "ISNULL"
strFormula = strFormula & " and " & strOption & "({CAO.DateClosed})"
End If
'CLOSED ITEMS ONLY
If optOpen(1).Value = True Then
strOption = "Closed"
strFormula = strFormula & " and " & strOption & "({CAO.DateClosed})"
End If
Much help needed
JPBinary
MCSE, MCSA
If IsDate(txtStartDate) And IsDate(txtEndDate) Then
dteReturnValue = txtStartDate
dteReturnValue2 = txtEndDate
strControl = Format$(dteReturnValue, "yyyymmdd"
strControl2 = Format$(dteReturnValue2, "yyyymmdd"
strFormula = "{CAO.DateReceived} in Date(" & Left(strControl, 4) & "," & Mid(strControl, 5, 2) & "," & Right(strControl, 2) & " to Date(" & Left(strControl2, 4) & ", " & Mid(strControl2, 5, 2) & "," & Right(strControl2, 2) & "" & " and {CAO.Assignee} = '" & (cboAssignee.Text) & "'"
'OPEN ITEMS ONLY
If optOpen(0).Value = True Then
strOption = "ISNULL"
strFormula = strFormula & " and " & strOption & "({CAO.DateClosed})"
End If
'CLOSED ITEMS ONLY
If optOpen(1).Value = True Then
strOption = "Closed"
strFormula = strFormula & " and " & strOption & "({CAO.DateClosed})"
End If
Much help needed
JPBinary
MCSE, MCSA