I get a "Run time error 3265 Item not found in this collection." message at If xmax < d3y!KVA(i) Then when running this code.
Any help?
Private Sub Command0_Click()
Dim db As DAO.Database
Dim d3y As Recordset
Dim KVA(36) As Integer
Dim MAX As Single
Dim MIN As Single
Dim xmax As Single
Dim xmin As Single
Dim i As Single
Set db = CurrentDb()
Set d3y = db.OpenRecordset("Devices3YearsT", dbOpenDynaset)
With d3y
Do Until d3y.EOF
xmin = 0
xmax = 0
For i = 1 To 36
If xmax < d3y!KVA(i) Then
xmax = d3y!KVA(i)
End If
If xmin > d3y!KVA(i) Then
xmin = d3y!KVA(i)
End If
Next i
.Edit
!MAX = xmax
!MIN = xmin
.Update
d3y.MoveNext
Loop
End With
End Sub
Any help?
Private Sub Command0_Click()
Dim db As DAO.Database
Dim d3y As Recordset
Dim KVA(36) As Integer
Dim MAX As Single
Dim MIN As Single
Dim xmax As Single
Dim xmin As Single
Dim i As Single
Set db = CurrentDb()
Set d3y = db.OpenRecordset("Devices3YearsT", dbOpenDynaset)
With d3y
Do Until d3y.EOF
xmin = 0
xmax = 0
For i = 1 To 36
If xmax < d3y!KVA(i) Then
xmax = d3y!KVA(i)
End If
If xmin > d3y!KVA(i) Then
xmin = d3y!KVA(i)
End If
Next i
.Edit
!MAX = xmax
!MIN = xmin
.Update
d3y.MoveNext
Loop
End With
End Sub