Populate field in new record with last record's value

G

Guest

Is there a way, that if a user clicks the 'new' record selector button, that
a new record can be created with a default field value from the last record?
I know I can do it in a button, but I'm trying not to hide the record
selector buttons. Thanks.
 
M

Marshall Barton

Alex said:
Is there a way, that if a user clicks the 'new' record selector button, that
a new record can be created with a default field value from the last record?
I know I can do it in a button, but I'm trying not to hide the record
selector buttons.


You can use the control's AfterUpdate event to set its value
as its DefaultValue (for any new records that are added
later). The code for this is:

Me.controlname.DefaultValue = """" & Me.controlname & """"

Note that this will reset the default value any time a user
enters or edits the value, but not if the default value is
accepted as is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top