Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2002
    Location
    India
    Posts
    38

    Unanswered: Declaring Array -Urgent

    HI to All
    I got irretation to work with arrays.
    Because While running the folling code I got the Error message Subscript OutOfRange. How do I solve this?
    Code:
    Dim MyArr()
      For I=1 to 5
        ReDim Preserve MyArr(I,2)
        MyArr(I,0)="No"
        MyArr(I,1)="Name"
        MyArr(I,2)="Amount"
      Next


    Please Help me
    -- Prasad --

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    You can only use preserve when you are changing the last dimension - not the first. What are you trying to accomplish ?

  3. #3
    Join Date
    Feb 2002
    Location
    India
    Posts
    38

    for Insertig a Records

    Hi
    I have a routine like calulating the State,City,county,Other Taxes. It has some calculation with some other Fields.
    Once the Calculation has finished I need to Insert the Records In Mytable Like // AutoNum, AcNo,State,City,County,Other //. In this case
    if i insert in forLoop every state,city.... will insert diff rows Like
    Code:
      AutoNo,Acno,State,0,0,0
    But I need the Row to Insert All Taxes.

    Because of this I am just trying to insert into Array and then inserting.
    -- Prasad --

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    I would use a programmatically created recordset and not an array. This is a recordset that is not tied to a database but rather fields you create dynamically and can manipulate like a recordset. It also gives you many more options to handle the data since methods already exist.

    Let me know if you need further assistance.

    Good luck.

Posting Permissions

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