好不容易登陆成功.用这段代码好了.
Dim I As Integer
Dim n As Integer
Dim Intsz() As Integer
Dim strsql As String
Dim rst As Object
strsql = "SELECT 表1.id FROM 表1 WHERE 表1.单位='甲等'"
Set rst = CurrentDb.OpenRecordset(strsql)
rst.MoveLast
rst.MoveFirst
n = rst.RecordCount
ReDim Intsz(1 To n)
For I = 1 To n
Intsz(I) = rst("id")
rst.MoveNext
Debug.Print Intsz(I),
Next I
Set rst = Nothing