Solved

Run-Time Error 3265 Item not found in this collection

Posted on 2015-02-18
5
89 Views
Last Modified: 2015-02-23
I added these below code to a procedure that I have. This procedure applies text to fields for records that are selected.
Basically copies information from one record to other records that need the same data in the two fields I added.

 qdTMMK.Parameters(11) = Me.ToyotaRank
            qdTMMK.Parameters(12) = Me.QreRank

Open in new window


I'm getting the "Run-Time Error 3265 Item not found in this collection"

Any ideas where I need to look?
0
Comment
Question by:ggodwin
  • 3
5 Comments
 

Author Comment

by:ggodwin
ID: 40617677
Here is the entire function

Sub CopyMultipleQrevalueTMMK_SelectByTagNumber()
Dim rsTMMK As DAO.Recordset
Dim qdTMMK As QueryDef
Dim reccountTMMK As Long
Dim copycountTMMK As Long
Dim msgStringTMMK As String
 
Set rsTMMK = Me.qQreValueTMMKVEHSubform.Form.RecordsetClone
If Not ((rsTMMK.BOF) And (rsTMMK.EOF)) Then
    rsTMMK.MoveLast
    reccountTMMK = rsTMMK.RecordCount
    Debug.Print reccountTMMK & " records in subform"
    rsTMMK.MoveFirst
     
    For ctr = 1 To rsTMMK.RecordCount
        If rsTMMK.Fields("Select") = True And rsTMMK("tagNumber") <> Me.TagNumber Then
            copycountTMMK = copycountTMMK + 1
            Debug.Print "*** Copying details to SKPI with Tagnumber " & rsTMMK.Fields("tagNumber")
            Set qdTMMK = CurrentDb.QueryDefs("qryUpdateQreValue_TagNumber")
            qdTMMK.Parameters("strTagNumber") = rsTMMK.Fields("tagNumber")
            'Fill in the form-based params
            qdTMMK.Parameters(1) = Me.ProblemDescription
            qdTMMK.Parameters(2) = Me.HowFound
            qdTMMK.Parameters(3) = Me.QREConfirmation
            qdTMMK.Parameters(4) = Me.InterimAction
            qdTMMK.Parameters(5) = Me.QualitAlertNumber
            qdTMMK.Parameters(6) = Me.SortedQuantity
            qdTMMK.Parameters(7) = Me.SortRejects
            qdTMMK.Parameters(8) = Me.[SortCompletion Date]
            qdTMMK.Parameters(9) = Me.SortYesNo
            qdTMMK.Parameters(10) = Me.DateCode
            qdTMMK.Parameters(11) = Me.ToyotaRank
            qdTMMK.Parameters(12) = Me.QreRank

'            For x = 0 To qdTMMK.Parameters.Count - 1
'                Debug.Print x; qdTMMK.Parameters(x).Name & vbTab & vbTab & qdTMMK.Parameters(x).Value
'            Next
            qdTMMK.Execute
            Set qdTMMK = Nothing
        ElseIf rsTMMK("tagNumber") = Me.TagNumber Then
            Debug.Print "Skipping TagNumber" & rsTMMK("tagNumber") & " because it is the record being edited in the main form."
        End If

Open in new window

0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 40617699
which line is highlighted when you get the error?
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40617713
the parameters collection is zero based, so you probably need to change the values of each of the parameter indices (0-11), or use the actual name of the parameter:

qdTMMK.Parameters("ProbDescription") = me.ProblemDescription
0
 

Accepted Solution

by:
ggodwin earned 0 total points
ID: 40617770
I actually found this one on my own.

The new field/form parameters that I entered had to be included in
the query. "qryUpdateQreValue_TagNumber".

Complete oversight on my part
0
 

Author Closing Comment

by:ggodwin
ID: 40625317
found on my own
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Retrieve Windows Office Files from Parallels 12 VM 9 60
TRIM a textbox value MS Access 10 23
Field behavior for "locked" form 12 29
Track name AutoCorrect info 14 46
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now