"Run-time error '3265': Item not found in this collection" when click print report 
Author Message
 "Run-time error '3265': Item not found in this collection" when click print report
Hi,

When i click my print report button which i am using Crystal Report 8.0.  I
get the error on my subject.  I read what that error number suppose to be
which "if a field not found then that error comes on VB 6".  My question is
that I have checked all the field names spelling and setting on my database
as well as on all my "tdfNew As TableDef".  But I don't seem to fix the
error.  My code is as follows:  on Sub DoPrint(intPrintStyle As Integer,
intPreview As Integer) I have "FillREntryDb strPrintDb" and the
"FillREntryDB" is my problem.

By the way "I am still getting that "Declare 'varBookmark' with an
early-bound data type" when I run FixIT program.

Please help if I am doing something wrong in this code.

Thanks!!!

The code for "FillREntryDb is as follows:

Sub FillREntryDb(strDBPath As String)
'adds the current record's data to the selected database
Dim dbWS As Workspace
Dim tdfNew As TableDef
Dim dbREntry2 As DAO.Database
Dim rsDb As DAO.Recordset
Dim strTemp As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim rsTemp(10) As DAO.Recordset
'FIXIT: Declare 'varBookmark' with an early-bound data type
Dim varBookmark(10) As Variant

    'clone the recordset to prevent strange things from happening
    varBookmark(0) = frmREntry.Data1.Recordset.Bookmark
    Set rsTemp(0) = frmREntry.Data1.Recordset.Clone
    For i = 0 To (frmREntry.daTabs.Count - 1)
        If frmREntry.daTabs(i).Recordset.RecordCount > 0 Then
         varBookmark(i) = frmREntry.daTabs(i).Recordset.Bookmark
    End If
        Set rsTemp(i) = frmREntry.daTabs(i).Recordset.Clone
    Next i

    Set dbREntry2 = OpenDatabase(strDBPath, False, False)

    'load REntry data
    With rsTemp(0)
        Set rsDb = dbREntry2.OpenRecordset("Tb_REntry")
        rsDb.AddNew

        For i = 0 To (.Fields.Count - 1)
            rsDb.Fields(.Fields(i).Name).Value = .Fields(i).Value
        Next i
        rsDb.Update

    End With

    'load Detail data
    For j = 0 To (frmREntry.daTabs.Count - 1)
        With rsTemp(j)
            Set rsDb = dbREntry2.OpenRecordset(.Name)
            'If a record or field is null skip it
            If .RecordCount > 1 Then
                .MoveFirst
            End If

            For k = 0 To (.RecordCount - 1)
                rsDb.AddNew
                For i = 0 To (.Fields.Count - 1)
                    rsDb.Fields(.Fields(i).Name).Value = .Fields(i).Value
                Next i
                rsDb.Update

                If k < .RecordCount Then .MoveNext
            Next k
        End With
    Next j

    'reset bookmarks
    frmREntry.Data1.Recordset.Bookmark = varBookmark(0)
    For i = 0 To (frmREntry.daTabs.Count - 1)
        If frmREntry.daTabs(i).Recordset.RecordCount > 0 Then
            frmREntry.daTabs(i).Recordset.Bookmark = varBookmark(i)
        End If
    Next i

    dbREntry2.Close

End Sub



Tue, 06 Dec 2005 06:19:07 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Run-time error '3265': Item not found in this collection

2. Run-time error 3265: Item not found in this collection

3. Run Time Error 3265: Item cannot be found in the collection

4. 3265 runtime error, item not found in collection

5. 'Item not found in this collection' (run time error 3265)

6. Error 3265:Item not found in this collection

7. Error 3265 Item not found in this collection

8. Error 3265:Item not found in this collection

9. Error 3265 - Item not found in this collection

10. Run-time error '3265'

11. Global command object -- Run-time error '3265:' Item cannot be found in the collection....

12. Run time error '3265' Item cannot be found in collection.......

 

 
Powered by phpBB® Forum Software