Populating fields with previous values (1 Viewer)

G

grizzes

Guest
I am trying to automatically bring in the last values of each field of a record into the fields of a new record to minimize typing for my sales guys.

Specifically, a form must be created every time a test is run on a piece of equipment. Generally the fields will not change for a piece of equipment, but they sometimes will.

The equipment and information that does not change is set in one table. The fields which can change per analysis is set in a separate table which is linked to the equipment table.

I can get it to find the last record per piece of equipment but I can't figure out how to get the new record to read the last record - so that I can populate the new fields with the old fields' values.

I would appreciate any ideas.
 
C

Chris Holmes

Guest
You can use the DLookUp function, here's an example:

=DLookUp("[Field]","Table","[ID]=Forms!_
[Form1]![ID]-1)

Where the ID is the autonumber index you're using. If you need this value in a table, use the DLookUp function in an update query.

Hope this helps.
 

Taz

New member
Local time
Today, 17:26
Joined
Jan 2, 2000
Messages
8
grizzes:

If your salespeople don't mind, you can use ctrl-' (apostrophe), and it will automatically fill in the field with the data that was used in the previous record.

As in:

if you have a field called Product Type and you are entering "Electronics" for every single record, you can press ctrl-' and it will put in "Electronics" in each consecutive record.

I'm sure the more VBA inclined folk can even turn the ctrl-' into a macro or code and automate it.

Hope this helps.

Todd
 

Users who are viewing this thread

Top Bottom