Yes i know i'm talking to myself but what the hell.
For anyone interested, the above method i showed is bad. Here is a better way.
Call BubbleSort(CustomerArray) 'To call the procedure
Private Sub BubbleSort(theArray() As CustomerRecord)
Dim pass As Integer, compare As Integer
Dim hold As CustomerRecord
Dim CurrentNumber As Integer, NextNumber As Integer
'Customer Number is converted to an integer instead of a string
'otherwise when sorting it only converts the first character
For pass = 1 To (UBound(theArray) - 1)
For compare = 1 To (UBound(theArray) - 1)
CurrentNumber = theArray(compare).Number
NextNumber = theArray(compare + 1).Number
If CurrentNumber > NextNumber Then
hold = theArray(compare)
theArray(compare) = theArray(compare + 1)
theArray(compare + 1) = hold
End If
Next compare
Next pass
End Sub
Also i have attached a program that i'm quite please with. It allows you to add records to an array, Display the array, Save the array to file, Search for records in the array, Goto the next and previous records.
Not bad for a begginer.