Dear all,
I am trying to add a new record to a table by code (first time - quite excited).
Here is the code:
Dim Rst As Recordset
Set Rst = CurrentDb.OpenRecordset("Tbl_MTR_Development_Testing_Detail")
Rst.AddNew
Rst!MTR = Me.MTR.Value
Rst!Detail_Date = Date
Rst!Detail_Name = Me.MTR_Report_By.Value
Rst!Details = "New MTR"
Rst!Detail_Status = "MR"
Rst.Update
Set Rst = Nothing
I am receiving a type mismatch error which fails when setting the Recordset. Have I declared the recordset incorrectly? In the example code I used as a basis for this, the developer coded:
Dim rst as DAO.recordset.
I do not have the DAO option presented to me when declaring the variable.
Regards
Withnail
I am trying to add a new record to a table by code (first time - quite excited).
Here is the code:
Dim Rst As Recordset
Set Rst = CurrentDb.OpenRecordset("Tbl_MTR_Development_Testing_Detail")
Rst.AddNew
Rst!MTR = Me.MTR.Value
Rst!Detail_Date = Date
Rst!Detail_Name = Me.MTR_Report_By.Value
Rst!Details = "New MTR"
Rst!Detail_Status = "MR"
Rst.Update
Set Rst = Nothing
I am receiving a type mismatch error which fails when setting the Recordset. Have I declared the recordset incorrectly? In the example code I used as a basis for this, the developer coded:
Dim rst as DAO.recordset.
I do not have the DAO option presented to me when declaring the variable.
Regards
Withnail