Consulting

Results 1 to 4 of 4

Thread: loading array with dates

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    loading array with dates

    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.
    Last edited by Bob Phillips; 04-09-2019 at 02:48 AM. Reason: Added code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •