jimwaite
asked on
VB Run Time Error 3265 "item not found in this collection"
Hello people.
I am receiving the VB run time error 3265 "item not found in this collection"
This is my code: can't see anything unusual:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --
Dim CarMake As String
Dim CarModel As String
Dim CarMileage As Long
Dim CarEngine As Long
Dim CarChassis As Long
Dim CarColour As String
Dim CarNoServices As Integer
Dim CarServiceRefs(5) As Integer
CarMake = Form1.Text1.Text
CarModel = Form1.Text2.Text
CarMileage = Form1.Text3.Text
CarEngine = Form1.Text4.Text
CarChassis = Form1.Text5.Text
CarColour = Form1.Text6.Text
CarNoServices = Form1.Text7.Text
CarServiceRefs(1) = Form1.Text8.Text
CarServiceRefs(2) = Form1.Text9.Text
CarServiceRefs(3) = Form1.Text10.Text
CarServiceRefs(4) = Form1.Text11.Text
CarServiceRefs(5) = Form1.Text12.Text
dclExample.Recordset.AddNe w
dclExample.Recordset!Make = CarMake
dclExample.Recordset!Model = CarModel
dclExample.Recordset!Milea ge = CarMileage
dclExample.Recordset!Engin eSize = CarEngine
dclExample.Recordset!Chass isNumber = CarChassis
dclExample.Recordset!Colou r = CarColour
dclExample.Recordset!Numbe rOfService s = CarNoServices
dclExample.Recordset!Servi ceReferenc eNumber(1) = CarServiceRefs(1)
dclExample.Recordset!Servi ceReferenc eNumber(2) = CarServiceRefs(2)
dclExample.Recordset!Servi ceReferenc eNumber(3) = CarServiceRefs(3)
dclExample.Recordset!Servi ceReferenc eNumber(4) = CarServiceRefs(4)
dclExample.Recordset!Servi ceReferenc eNumber(5) = CarServiceRefs(5)
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --
Any ideas?
I am receiving the VB run time error 3265 "item not found in this collection"
This is my code: can't see anything unusual:
--------------------------
Dim CarMake As String
Dim CarModel As String
Dim CarMileage As Long
Dim CarEngine As Long
Dim CarChassis As Long
Dim CarColour As String
Dim CarNoServices As Integer
Dim CarServiceRefs(5) As Integer
CarMake = Form1.Text1.Text
CarModel = Form1.Text2.Text
CarMileage = Form1.Text3.Text
CarEngine = Form1.Text4.Text
CarChassis = Form1.Text5.Text
CarColour = Form1.Text6.Text
CarNoServices = Form1.Text7.Text
CarServiceRefs(1) = Form1.Text8.Text
CarServiceRefs(2) = Form1.Text9.Text
CarServiceRefs(3) = Form1.Text10.Text
CarServiceRefs(4) = Form1.Text11.Text
CarServiceRefs(5) = Form1.Text12.Text
dclExample.Recordset.AddNe
dclExample.Recordset!Make = CarMake
dclExample.Recordset!Model
dclExample.Recordset!Milea
dclExample.Recordset!Engin
dclExample.Recordset!Chass
dclExample.Recordset!Colou
dclExample.Recordset!Numbe
dclExample.Recordset!Servi
dclExample.Recordset!Servi
dclExample.Recordset!Servi
dclExample.Recordset!Servi
dclExample.Recordset!Servi
--------------------------
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dclExample.Recordset!Servi
dclExample.Recordset!Servi
dclExample.Recordset!Servi
dclExample.Recordset!Servi
dclExample.Recordset!Servi
My guess is it's choking on the parentheses. The ! operator on the recordset is really a shorthand for saying...
dclExample.Recordset.Field
'etc.
This would only be valid if there were actually a field named ServiceReferenceNumber(1),
What is the actual field name? (Or am I wrong?)