Solved

Run-Time Error 3265 Item not found in this collection

Posted on 2015-02-18
5
87 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
Comment Utility
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
Comment Utility
which line is highlighted when you get the error?
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
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
Comment Utility
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
Comment Utility
found on my own
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

762 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

7 Experts available now in Live!

Get 1:1 Help Now