I have a form which comprise of a texbox bound to a field called Year1. I want to create a new record using the new record controls in the bottom of the form and have the value on the previous record carried forward to the new record. I tried the following codes but no luck. Any help is greatly appreciated. Below is my first approach:
Private Sub Form_Current()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblMyTable")
rs.AddNew
rs.Fields("Year1").Value = Year1.Value
rs.Close
End Sub
I have also tried the following approach but no luck:
Private Sub Form_Current()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblMyTable")
rs.Edit
rs!Year1 = Year1.Value
rs.Update
rs.Close
End Sub