Join Variable With Number

  • interesting problem I've come across.


    Essentially I count the number of rows (n) in a dataset and need to dim a [v]*[/v] for each row (i) ...


    for example:


    the question is how to dim and name the variable and join with the increment - Dim logsiteId & myVariableInc ... whose desired result would be logsiteId1, logsiteId2 and so on.


    hopefully someone has an idea ... or knows ...


    /Nick

    <b><font color="#23069E">_NFio_</font></b>

  • Re: Dim Variable Name Concatenated With Integer


    You should use an array.


    [vba]
    Dim logsiteId(ds.Tables(0).Rows.Count)[/vba]


    You seemed to be using syntax from a non VBA language
    [vba] myVariableInc += 1
    ' should be
    myVariableInc = myVariableInc + 1 [/vba]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!