Dim rsi As Integer
Dim sl As Integer
sl = 0
Dim rssum As New ADODB.Recordset
rssum.Open "select * from 入库明细临时TAB", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rssum.MoveFirst
For rsi = 1 To rssum.RecordCount
sl = sl + rssum("数量")
rssum.MoveNext
Next rsi