Private Sub cmd录入_Click()
'数据不完整不能录入
If Nz(Me.姓名.Value) = "" Or Nz(Me.产品.Value) = "" Or _
Nz(Me.日期.Value) = "" Or Nz(Me.件数.Value) = "" Then
MsgBox "信息没有输入完整,不能够录入!"
Exit Sub
End If
'通过ADODB方法获取T计件表中的记录集
Dim rst As New ADODB.Recordset
Dim strSQL As String
strSQL = "select * from T计件表 "
rst.Open strSQL, CurrentProject.Connection, adOpenKeyset, _
adLockOptimistic
rst.AddNew '添加记录
rst!姓名.Value = Me.姓名.Value
rst!产品.Value = Me.产品.Value
rst!日期.Value = Me.日期.Value
rst!件数.Value = Me.件数.Value
rst!备注.Value = Me.备注.Value
rst.Update '更新记录
rst.Close
Set rst = Nothing
MsgBox Me.日期.Value & Me.姓名.Column(1) & "的工作量录入成功!"
End Sub
我也不懂但是这样就行了,请高人逐句解释下代码。让小白们学习