DBinPhilly
04-08-2019, 04:04 AM
I'm trying to load an array with a series of dates. I keep getting a 'subscript out of range' error, which I assume means that the date is coming in the wrong format, maybe?
The data being read (we!WEdate) is a date format field.
Here is my code:
Option Base 1
'define the array
Dim A() As Variant, i As Integer
A = Array(52)
____________________________________________
'after defining the database and recordset:
we.MoveFirst
i = 1
rewe:
If we.EOF Then GoTo Donewe
A(i) = we!WEDate
i = i + 1
we.MoveNext
GoTo rewe
Donewe:
we.Close
_____________________________________________________
I've also tried this:
A(I) = "#" & we!WEDate & "#"
_____________________________________________________
what am I doing wrong? It's been years since I've worked with arrays, because I do very little development work now.
The data being read (we!WEdate) is a date format field.
Here is my code:
Option Base 1
'define the array
Dim A() As Variant, i As Integer
A = Array(52)
____________________________________________
'after defining the database and recordset:
we.MoveFirst
i = 1
rewe:
If we.EOF Then GoTo Donewe
A(i) = we!WEDate
i = i + 1
we.MoveNext
GoTo rewe
Donewe:
we.Close
_____________________________________________________
I've also tried this:
A(I) = "#" & we!WEDate & "#"
_____________________________________________________
what am I doing wrong? It's been years since I've worked with arrays, because I do very little development work now.