将未绑定的文本字段写入表格的表单

时间:2016-03-06 02:33:09

标签: ms-access ms-access-2010

我在点击时运行此代码,Dim R As Recordset时出现错误:

Private Sub Command12_Click()
    Dim R As Recordset

    Set R = CurrentDb.OpenRecordset("SELECT * FROM [tblLogData]")
    R.AddNew
    R![Data] = "Log entry" & Me.tDate.Value
    R.Update
    R.Close
    Set R = Nothing
    DoCmd.Close
End Sub 

1 个答案:

答案 0 :(得分:0)

如果这样做不能删除错误:

Dim R As DAO.Recordset

您缺少对 Microsoft Office xx.0 Access数据库引擎对象库的引用。