2
我第一次使用.Sort,但從谷歌搜索以下應該工作,但調試打印輸出不排序。Recordset.Sort方法不排序
Function SortByYear(ByVal z As DAO.Recordset) As String
Dim mySortedRS As DAO.Recordset
z.Sort = "Year"
Set mySortedRS = z
Do
Debug.Print mySortedRS!Year
mySortedRS.MoveNext
Loop Until mySortedRS.EOF
Set mySortedRS = Nothing
End Function
啊哈!我看到我的錯誤。謝謝...順便說一句,我看到彈出氣球在這裏說,以避免感謝評論...似乎很粗魯,做到這一點。 – Kirk 2014-11-24 13:31:26
@Kirk這只是努力減少評論中的「噪音」。你總是可以通過upvoting和/或[accepting]來說「謝謝」(http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235)。 – 2014-11-24 13:39:29