Hi! I have a problem I don't know what have I need to select some records from a Crystal report, I need to select some range of dates and it always send me a message telling me that there is an error in the formula.
Can you help me it drives me crazy!!

I will appreciate all your comments.

Thank you

This is the code:

Dim DocName As String
Dim LinkCriteria As String

CrystalReport4.Connect = "DSN = hoy;UID=;PWD=;DSQ="


a = "Date(1999,01,01)"
b = "Date(1999,01,30)"

Thank you!!!
Yoya
c2 = "="
c1 = "{Com.date}"
c3 = "<="
y = "and"

Set rep = CrystalReport4
rep.SelectionFormula = "" & c1 & " " & c2 & " '" & a & "''" & y & " " & c1 & " " & c3 & " '" & b & "'"
rep.ReportFileName = "d:\personal\vb_access\salidas.rpt"

errorhandler:
Select Case Err.Number
Case 20515: 'Resume Next
MsgBox ("There is an error in the selection")
Resume Next
End Select
On Error GoTo errorhandler
rep.Action = 2