Trying to run the following code to add a record to a table based on data within an unbound form. The code halts at line 5 with the error message "Run time error 13: Type missmatch". I can't work out why but it's probably very simple. I've not done this type of thing before.
Private Sub Command12_Click()
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_TempCurrentStockTakeArchive")
With rst
.AddNew
![Account Code] = "Work In Progress"
![Stock Take Date] = Me.txt_StockTakeDate
![Stock Value] = Me.txt_StockTakeDate
.Update
End With
rst.Close
End Sub
Private Sub Command12_Click()
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_TempCurrentStockTakeArchive")
With rst
.AddNew
![Account Code] = "Work In Progress"
![Stock Take Date] = Me.txt_StockTakeDate
![Stock Value] = Me.txt_StockTakeDate
.Update
End With
rst.Close
End Sub