S
Stuart Grant
I have a project with an Input Form. The first field (after an AutoNumber
ID) is TranDate. Since there are often quite a number of the same
transactions on any date, I would like the date of the previous record to
carry over to a new one.
Allen Browne has a macro to carry over all the fields to a new record but I
only want to carry over the date field since the others are almost never the
same. The date goes in a Text Box named txtTranDate.
I tried to modify Allen's syntax but can't get it to work. In the form's
BeforeInsert Event you enter the Event Procedure "Call CarryOver(Me). The
code I have written for the sub CarryOver(frm As Form) is
Dim rst As DAO.Recordset
Set rst = frm.RecordsetClone
If rst.RecordCount > 0 Then
rst.MoveLast
frm.txtTranDate = rst("TranDate")
End If
But it does not work. Can anyone help ?
Stuart
ID) is TranDate. Since there are often quite a number of the same
transactions on any date, I would like the date of the previous record to
carry over to a new one.
Allen Browne has a macro to carry over all the fields to a new record but I
only want to carry over the date field since the others are almost never the
same. The date goes in a Text Box named txtTranDate.
I tried to modify Allen's syntax but can't get it to work. In the form's
BeforeInsert Event you enter the Event Procedure "Call CarryOver(Me). The
code I have written for the sub CarryOver(frm As Form) is
Dim rst As DAO.Recordset
Set rst = frm.RecordsetClone
If rst.RecordCount > 0 Then
rst.MoveLast
frm.txtTranDate = rst("TranDate")
End If
But it does not work. Can anyone help ?
Stuart