Copying data from another record

  • Thread starter Thread starter Michael Iannantuoni
  • Start date Start date
M

Michael Iannantuoni

Being fairly new to Access, can anyone tell me please is it possible to
copy data, a field at a time from a previously displayed record.

The situation is that I have a lot of records to enter that contain data
that is either very similar to existing records or similar to each other.

My ancient DOS database used to allow the insertion into a new record of
data from the previously displayed record one field at a time by simply
pressing F4. Can Access do anything like this or can a Form be
programmed to do this?

TIA

Michael
 
Michael,
Use Ctrl-' (single quote) to copy the value from that field in the last
record to the field in the new record.

An better method is to use the AfterUpdate of a control to set the
DefaultValue for that field.
Private Sub YourField_AfterUpdate()
YourField.DefaultValue = " ' " & YourField & " ' "
End Sub
(I've added spaces between the quotes for clarity... remove them in your
code)

If you enter "ABC" in YourField, every new record's YourField will have
that value as a default.... until you enter a different value in that field.
Then... that new value becomes the default... and so on...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
To copy the data for the current field, use Ctrl+' (i.e. hold down control,
and hit apostrophy.)

You can also program the form to insert the values from the last record when
you start entering a new one. Details in:
Assign default values from the last record
at:
http://allenbrowne.com/ser-24.html
 
Michael Iannantuoni said:
Being fairly new to Access, can anyone tell me please is it possible to
copy data, a field at a time from a previously displayed record.

The situation is that I have a lot of records to enter that contain data
that is either very similar to existing records or similar to each other.

My ancient DOS database used to allow the insertion into a new record of
data from the previously displayed record one field at a time by simply
pressing F4. Can Access do anything like this or can a Form be programmed
to do this?

TIA

Michael

In Access, the hotkey is Ctrl+' (Ctrl plus apostrophe)
 
Thanks to everyone for their help.

Marshall said:
Access has the Ctrl+" key combination that will copy a field
from the previous record. The tricky part of that is making
sure you know which record is "previous".

If you want to copy **all** the **visible** fields from the
current record to a new record, you can use the form button
wizard to create some code to do it.

If you want something more sophisticated, you can use the
form's RecordsetClone to copy a set of specific fields to a
new record.

If you are just going to enter a bunch of new records with
some fields being the same on all the records, then you
could use the form text box's AfterUpdate event to set the
text box's DefaultValue property to the new value. All
subsequent new records will then pick up that value with no
user interaction.
 
Back
Top