October 16th, 2003, 05:43 AM
Error 3265. Item not found in this collection
I have a query with a parameter that references a form; I need to update the underlying table on which the query is based and have been trying to create some code to do so.
First of all I got an error 'Too few parameters. Expected 1' which is apparently caused because the query references a form. I modified the query temporarily so that it didn't reference the form and it worked but that is not an acceptable solution so I have modified my code as below but I now get an error 'Item not found in this collection'
Dim dbsA As Database, rstA As Recordset, qdfA As QueryDef
Set dbsA = CurrentDb
Set qdfA = dbsA.QueryDefs("Pricing Test")
qdfA![Forms]![Pricing Screen]![Site_id] = [Forms]![Pricing Screen]![Site_id]
Set rstA = dbsA.OpenRecordset("Pricing Test", dbOpenDynaset)
Any help appreciated.
October 24th, 2003, 12:57 PM
'Item not found in this collection' generally means the the field name you are referencing in you SQL statement doesn't exist in the table. Check to make sure you spelled the field name correctly.