When entering data into a table, I would like for some of the fields in the new/current record to default to the same value as entered in the previous record. Is there a function to do identify the previous record?
Thanks
When entering data into a table, I would like for some of the fields in the new/current record to default to the same value as entered in the previous record. Is there a function to do identify the previous record?
Thanks
One way:
http://access.mvps.org/access/forms/frm0012.htm
It gets more complicated if you want the last record, whenever it may have been entered, as opposed to the current session of the form being opened.
Why not just store the primary key field of the prior record instead, then you can just look the data you want up instead of repeating it. This would also prevent errors where the prior record may get updated but the same updates are not made on the 'new' record.
The primary key field (Entry ID) is auto generated so it is always 1 less than the current record but I am not sure how to use it in 'Expression Builder'.
if it's always the record prior to the current one you could fill it in the ON ENTER property of the field you could have code like
[PrevRec] = dmax("[PrimaryKeyField]", "TableName")