Preventing unwanted NewRecords

  • Thread starter Thread starter Jim Shaw
  • Start date Start date
J

Jim Shaw

BlankIs there a good way to prevent unintentional addition of records?

The controls on my form have default values defined to partially complete the form in NewRecord mode.

Problem is: When I delete the last record in my recordset, the form moves into NewRecord mode and sets up with the default values. When I click on a navigation button, a default record is added back into my record set! This record is not wanted.

My current workaround is to click Undo before clicking on a navigation button, but I don't think my users will remember to do that all of the time.

I need to keep the default value feature and the ability to explicitly add records.
 
Jim,

One way to handle this is to create a second copy of your
form and use one for adding new records and the other for
viewing / changing existing ones.
In the record adding one: change form property Data entry
to Yes (prevents users from accessing existing records)
In the view/change one: set property Allow Additions to
no, and remove the defaults.
Anohter security measure against accidental record
additions, if taht works for you, is to have a field as
required, with no default value set.

HTH,
Nikos
-----Original Message-----
BlankIs there a good way to prevent unintentional addition of records?

The controls on my form have default values defined to
partially complete the form in NewRecord mode.
Problem is: When I delete the last record in my
recordset, the form moves into NewRecord mode and sets up
with the default values. When I click on a navigation
button, a default record is added back into my record
set! This record is not wanted.
My current workaround is to click Undo before clicking on
a navigation button, but I don't think my users will
remember to do that all of the time.
 
BlankIs there a good way to prevent unintentional addition of records?

The controls on my form have default values defined to partially complete
the form in NewRecord mode.

Problem is: When I delete the last record in my recordset, the form moves
into NewRecord mode and sets up with the default values. When I click on a
navigation button, a default record is added back into my record set! This
record is not wanted.

My current workaround is to click Undo before clicking on a navigation
button, but I don't think my users will remember to do that all of the
time.


Default values *by themselves* will NOT create a new record. You could
have a default value defined for every single field and that would not
cause new records to be created.

Something has to "dirty" the record, either the user or some code/macro
running in the program. Do you have any code or macro that sets a
control/field value in the form's Current event?
 
Yes, I have custom navigation (command) buttons on the subform that are
enabled/disabled in the OnCurrent event for the subform.
-Jim
 
Back
Top