Results 1 to 2 of 2

Thread: [RESOLVED] Sorting data into an array & performing a calculation

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    1

    Resolved [RESOLVED] Sorting data into an array & performing a calculation

    The total amount of points each user has is added to a different score, to give a total score. This is then sorted into descending order. The names and average speed results for each user are sorted into the same position in their arrays as the points array. The names of the first 8 users with the highest scores are entered into 8 separate textboxes. I aimed for the first 8 results in the Speed Array to be in the same position in the array as the top 8 user's names, so that I was able to calculate the time it would take for them to run a certain distance. However, when I wrote the code so that the first 8 results stored in the speed array would be displayed in the text1 textbox on the form, they all showed the same number. The calculation works, but the values stored in the speed array are wrong and I can't figure out why. Any help would be greatly appreciated, screenshots of code and the form are attached.
    Attached Files Attached Files

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Sorting data into an array & performing a calculation

    It's hard to follow your code based on screenshots. Could be why not many replies to your thread.

    If the problem is that the speedarray(x) are all the same, it is probably because you are not moving the adoAverage recordset pointer in your Sub Points() loop
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width