Dim C As Integer
dim I As Integer
For i = Ubound(Array) To 1 Step -1
For C = 1 To i
If (Array(C) < Array(C - 1) _
Or Len(LTrim(Array(C - 1))) = 0) _
And Len(LTrim(Array(C))) <> 0 Then
' Swap the names over
StrTemp = Array(C)
Array(C) = Array(C - 1)
Array(C - 1)=StrTemp
' swap them
End If
Next C
Next i
Yes, I was aware of ADO, I tried it ahead of time with empty recordset and failed because I did MoveFirst first. It was one the reasons of posting the question. I did not realize that time that I still could loop through the fields on the empty recordset without MoveFirst and get the fields names in the "natural" table order.
strongm,
Thank for your responce, it made me try ADODB again.
PeterWallace,
Thank you for your example of code for sorting, it's always nice to have such things handy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.