default value not to create new record

  • Thread starter Thread starter Ron
  • Start date Start date
R

Ron

My problem in Access 2000 is default values in combos on
data input form create partial new record without any user
input. Annoying deleting new record before being able to
view existing records [OnLoad frm, I have GoToRec,frm,
acNewRec]. Data entered in some fields is often same for
half a dozen consecutive records, so I have AfterUpdate of
several combos changing their own default value to data
just entered. So data entry is quicker. But user often
wishes to edit records recently entered.
No problem if default value is in field in underlying
table, but Access doesn't seem to allow changing that
default value while form open [I used vb to try to change
TableDefs].
Any suggestions please?
 
My problem in Access 2000 is default values in combos on
data input form create partial new record without any user
input. Annoying deleting new record before being able to
view existing records [OnLoad frm, I have GoToRec,frm,
acNewRec]. Data entered in some fields is often same for
half a dozen consecutive records, so I have AfterUpdate of
several combos changing their own default value to data
just entered. So data entry is quicker. But user often
wishes to edit records recently entered.
No problem if default value is in field in underlying
table, but Access doesn't seem to allow changing that
default value while form open [I used vb to try to change
TableDefs].
Any suggestions please?

Unless the record is being dirtied, default values in controls won't generate
new records. What you are seeing is likely the new record placeholder which
displays default values in controls that have that property set. If there are,
in fact, new records being generated, I would suspect that you have some code
that is causing the new record to be created. The code that you mentioned
*isn't* the culprit, however.
 
Thanks Bruce,
I have a subs running on form events OnCurrent [calculates
a number for use by a control], & BeforeUpdate [checks if
nulls in any of the required fields, & this is my msgbox
that pops up that incomplete record so delete].
Running the BeforeUpdate subs only if form.dirty=true
should solve the problem then? Doing that for OnCurrent
wouldn't make sense would it? I'm not very experienced in
Access.
Thanks, Ron
-----Original Message-----
My problem in Access 2000 is default values in combos on
data input form create partial new record without any user
input. Annoying deleting new record before being able to
view existing records [OnLoad frm, I have GoToRec,frm,
acNewRec]. Data entered in some fields is often same for
half a dozen consecutive records, so I have AfterUpdate of
several combos changing their own default value to data
just entered. So data entry is quicker. But user often
wishes to edit records recently entered.
No problem if default value is in field in underlying
table, but Access doesn't seem to allow changing that
default value while form open [I used vb to try to change
TableDefs].
Any suggestions please?

Unless the record is being dirtied, default values in controls won't generate
new records. What you are seeing is likely the new record placeholder which
displays default values in controls that have that property set. If there are,
in fact, new records being generated, I would suspect that you have some code
that is causing the new record to be created. The code that you mentioned
*isn't* the culprit, however.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)within the newsgroups so that all might benefit.<<


.
 
Thanks again Bruce.
I had form's OnCurrent event setting its AllowEdits &
AllowDeletes properties from value of a checkbox. Changed
to jump that if form.NewRecord & problem solved.
Incidentally, OnLoad seems to run OnCurrent, then
OnCurrent runs on its own - don't know if that's normal.
Ron
 
Back
Top