Access问题急急急 求大神帮忙解决
access吧
全部回复
仅看楼主
level 1
khnpgy 楼主
Private Sub 录入_Click()
'数据不完整不能录入
If Nz(Me.姓名.Value) = "" Or Nz(Me.产品.Value) = "" Or _
Nz(Me.日期.Value) = "" Or Nz(Me.件数.Value) = "" Then
MsgBox "信息没有输入完整,不能够录入!"
Exit Sub
End If
'通过AKODB的方法获取T计件表中的记录集
Dim rst As ADODB.Recordset
Dim strSQL As String
strSQL = "select * from T计件表"
Set rst = New ADODB.Recordset
rst.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rst.AddNew '添加记录
rst!姓名.Value = Me.姓名.Value
rst!产品.Value = Me.产品.Value------在这出错了
rsr!日期.Value = Me.日期.Value
rst!件数.Value = Me.件数.Value
rst.Update '更新记录
rst.Close
Set rst = Nothing
MsgBox Me.日期.Value & Me.姓名.Column(1) & "的工作录入成功!"
2019年06月03日 04点06分 1
1