|
是这么个情况,想批量输入,但是一次只能一条,输入多少个就要点多少次,能否办到点一次就行了啊,谢谢
public Sub Command86_Click()
On Error GoTo Err_Command86_Click
b = MsgBox("是否使用面积公式", vbYesNo)
If b = vbYes Then
Me.Lable26 = Me.Lable12 * Me.Lable11 / 1000
End If
Dim stemp As String
a = InputBox("输入录入数量")
For i = 0 To a - 1
stemp = "INSERT INTO form5查询(Lable1,Lable21,Lable22,Lable3,Lable18,Lable5,Lable14,Lable2,Lable6,Lable12,Lable11,Lable26,Lable20,Lable23,Lable15,Lable13,Lable27)VALUES('" & Me.Lable1 & "','" & Me.Lable21 & "','" & Me.Lable22 & "','" & Me.Lable3 & "','" & Me.Lable18 & "','" & Me.Lable5 & "','" & Me.Lable14 & "','" & Me.Lable2 & "','" & Me.Lable6 & "','" & Me.Lable12 & "','" & Me.Lable11 & "','" & Me.Lable26 & "','" & Me.Lable20 & "','" & Me.Lable23 & "','" & Me.Lable15 & "','" & Me.Lable13 & "'," & i & ")"
DoCmd.RunSQL stemp
Me.Lable3 = Mid(Me.Lable3, 1, 10) & Format(Right(Me.Lable3, 4) + 1, "0000")
Next i
Exit_Command86_Click:
Exit Sub
Err_Command86_Click:
MsgBox Err.Description
Resume Exit_Command86_Click
End Sub |
|