Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: Upperbound of arry?

    I am adding missing ck# to an array. I would later like to put this in a lbl.caption

    i tried :

    For i = 0 To MissCk.upperbound - 1
    lbl.caption =lbl.caption & " " Cstr(MissCk(i))
    NEXT I

    I created missCK :

    Dim MissCK(250) as integer

    as this testing MissCk() has only 1 value.

    I would like to do something like

    For i=0 to MissCK.COUNT - So i dont have to go through all 251 loops
    which is what i think will happen with Upperbound if it worked. Any Help pls

    Also be as specific as possible, dont give me too much credit cause im flying blind!


    M~

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: Upperbound of arry?

    Originally posted by mikezcg
    I am adding missing ck# to an array. I would later like to put this in a lbl.caption

    i tried :

    For i = 0 To MissCk.upperbound - 1
    lbl.caption =lbl.caption & " " Cstr(MissCk(i))
    NEXT I

    I created missCK :

    Dim MissCK(250) as integer

    as this testing MissCk() has only 1 value.

    I would like to do something like

    For i=0 to MissCK.COUNT - So i dont have to go through all 251 loops
    which is what i think will happen with Upperbound if it worked. Any Help pls

    Also be as specific as possible, dont give me too much credit cause im flying blind!


    M~
    I know this is not answering your question about an array but I just thought I would suggest a collection as an alternative to an array. Look at the code below that I attached to a command button to test the collection.

    Private Sub Command1_Click()

    Dim colMissChecks As New Collection
    Dim x As Integer, strItem As String

    For x = 1 To 10
    strItem = "Check No. " & x
    colMissChecks.Add strItem
    Next

    MsgBox colMissChecks(5)

    End Sub

    Collections, in many cases, are easier to manage than arrays and can contain different data types within the same collection.

    Look up the word Collection in the Visual Basic help that ships with Access to learn more if this is looks like a reasonable alternative.

    Good Luck.

    Gregg

Posting Permissions

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