Birde sorguya sonuçları aktarmak kaldı geriye yani virgülle ayrılmış halleri.
Biraz uğraşaım.
Bende alttaki gibi döngü ile kod yapmıştım.
Private Sub Komut0_Click()
Dim rs As Recordset, kes As String , y As Integer
Dim scr As Object
Set rs = CurrentDb.OpenRecordset("select Alan1 from Tablo1 where Alan1 like '*,*'")
Set scr = CreateObject("Scripting.Dictionary")
If rs.RecordCount > 0 Then
Do While Not rs.EOF
kes = rs(0)
For y = 1 To Len(kes)
If Mid(kes, y, 1) = "," Then say = say + 1
Next
If Not scr.Exists(say) Then scr.Add say, ""
say = 0
rs.MoveNext
Loop
End If
bubble_sort (scr.Keys)
rs.Close
Set rs = Nothing
Set scr = Nothing
End Sub
Function bubble_sort(arr)
Dim x As Long, y As Long
For x = 0 To UBound(arr) - 1
For y = x To UBound(arr) - 1
If CDbl(arr(x)) < CDbl(arr(y)) Then
temp = arr(x)
arr(x) = arr(y)
arr(y) = temp
End If
Next
Next
bubble_sort = arr
MsgBox arr(0)
End Function