Add New Records (ie. not overwriting old records)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that is updated twice/day to reflect equipment status for the
next shift.

When the form is opened, the Form_Open event has:
Me.RecordSource = "qryChemTO_U" & varUnit
DoCmd.GoToRecord , , acLast

How can I open this form, display the most recent information, allow the
user to change the displayed info, AND save the new information as a new
record (without overwriting the old info).
 
Dear PosseJohn:


There are different ways to deal with this:

1. Do it manually: Open a new blank record and use the key combination
Ctrl-" , which will insert the value of the previous record's control into
the current record's control.

2. Do it with code:

Option 1. In the AfterUpdate event of each of your controls, reset the
default value of the control to the value that was just entered. Thus, when
you open a new record, it will insert the value from the previous record.
See: "Set the Default Value of each control in its AfterUpdate event" at
http://www.mvps.org/access/forms/frm0012.htm

You could also set this code up behind a command button, so that you can
decide whether you wish the previous record's value to be carried into the
new record or open a blank new record.

Option 2. Use the BeforeInsert event of the form to drop in the values:
http://members.iinet.net.au/~allenbrowne/ser-24.html


There may be other ways I don't know about, in addition! <g>

HTH
Fred Boer
 
Back
Top