Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2005
    Posts
    5

    Unanswered: Creating a dynamic array

    Good Day everyone,

    I have a code that generates a minimum and a maximum value. The maximum value is computed by adding a numeric value e.g
    min val = 02de65
    addition value = 10
    max val = 02de74

    The problem is that I need to store the incremented values (02de66,02de67,02de68 ......02de74) in an array or a table. I don't understand how to use code to create these values. Once I can create these values I could store them in an array and these use the recordset object to update the table.

    Any help?

    thanks in advance
    Michael-Teri

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    If you create a simple table you could then use
    doCmd.RunSQL with an insert statement.
    Combine this with a loop and you can store each value.

    Unsure about declaring an array - but I'm sure GolferGuy will will tell you!
    George
    Home | Blog

  3. #3
    Join Date
    Sep 2005
    Posts
    5
    Ok, then how do you create a loop to generate each iteration?

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    UNTESTED PSEUDO CODE:
    Code:
    For Each <minval> to <maxval>
    <minval> = <minval> + <increment>
    next <minval>
    George
    Home | Blog

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    OR
    Code:
    Do While minvalue < maxvalue
    ...
    minvalue = minvalue + additionvalue
    Loop
    George
    Home | Blog

  6. #6
    Join Date
    Sep 2005
    Posts
    5
    Thanks alot! the solution to the problem seemed complex....don't know why! but your solution works. Thanks....

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I'm sure there is an easier way... But I can't think of one
    George
    Home | Blog

Posting Permissions

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