Results 1 to 3 of 3

Thread: Run-Time Error 20515: E when trying to open CR

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    4

    Question Run-Time Error 20515: E when trying to open CR

    Hi Guys,
    Here when I'm trying to open a crystal report using vb application, I'm getting this error
    run-time error '20515':E
    and when I'm trying to debug it is pointing to

    crt1.Action = 1

    crt1 is crystal report control name.

    Plz. some one help me, why I'm getting this error....I'm also attaching the code here.


    Private Sub mnupreview_Click()
    ' {CUSTOMER_MAST.NAME}='ANDHRA SUGARS' and {CUST_QUOT_MAST.CQDATE} in Date (1999,02,12) to Date(1999,02,12)
    If cmbcode.text = "" Then
    MsgBox "Please Select Customer Name", vbInformation, "Error"
    Exit Sub
    End If
    If DTPicker1.VALUE > DTPicker2.VALUE Then
    MsgBox "To Date must be grater than from date", vbInformation, "Error"
    Exit Sub
    End If

    Set r = db.OpenRecordset("SELECT CODE FROM CUSTOMER_MAST WHERE NAME='" & cmbcode.text & "'")
    Set R1 = db.OpenRecordset("SELECT * FROM CUST_PUR_ORDMAST WHERE CODE='" & r.Fields("CODE") & "' AND " & "CORDDATE BETWEEN #" & Format(DTPicker1.VALUE, "mm/dd/yyyy") & "# AND #" & Format(DTPicker2.VALUE, "mm/dd/yyyy") & "#")
    If R1.RecordCount = 0 Then
    MsgBox "There is no Transactions In this Dates", vbInformation, "No Records"
    Exit Sub
    End If
    Dim s As String
    s = "{CUSTOMER_MAST.CODE}= '"
    s = s + r.Fields("CODE")
    s = s + "' AND "
    s = s + "{CUST_PUR_ORDMAST.CORDDATE} in Date ("
    s = s + Format(DTPicker1.VALUE, "YYYY,MM,DD")
    s = s + ")"
    s = s + " TO DATE ("
    s = s + Format(DTPicker2.VALUE, "YYYY,MM,DD")
    s = s + ")"
    crt1.SelectionFormula = s
    crt1.Formulas(0) = "COMPNAME =" & "'" & cmbcode.text & "'"
    crt1.Formulas(1) = "fdate ='" & Format(DTPicker1.VALUE, "dd/mm/yyyy") & "'"
    crt1.Formulas(2) = "tdate ='" & Format(DTPicker2.VALUE, "dd/mm/yyyy") & "'"
    crt1.Action = 1
    End Sub

    Thanks in advance...

  2. #2
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: Run-Time Error 20515: E when trying to open CR

    what is error desription ?

  3. #3
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: Run-Time Error 20515: E when trying to open CR

    can you send me screen-shot of that error ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width