|
原帖由 Henry D. Sy 于 2009-1-23 05:33 发表
建议,
将编号12起删除掉,
然后用追加查询
否则只能用记录集
Private Sub Command10_Click()
Dim strSQL As String
Dim varArray(7) As Variant
Dim rs As New ADODB.Recordset
Dim i As Integer
If IsNull(Me.Combo2) Or IsNull(Me.Combo7) Then
Exit Sub
End If
strSQL = "select a,b,c,d,f,g,h,z from 表1 where batch=" & Me.Combo2
With rs
.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockReadOnly
For i = 0 To .Fields.Count - 1
varArray(i) = .Fields(i)
Next
.Close
End With
strSQL = "select a,b,c,d,f,g,h,z from 表1 where batch=" & Me.Combo7
With rs
.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
For i = 0 To .Fields.Count - 1
.Fields(i) = varArray(i)
Next
.Update
.Close
End With
Set rs = Nothing
MsgBox "Copied"
End Sub |
|