Copying a value from one record to the next if another field is sa

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

Guest

Hi, I'm new to Acces and self-taught, so please forgive my ignorance if my
question is muddled or uses imprecise terms.

I have a form that describes a specimen generally (type of specimen, side it
comes from, color, weathering, etc). This form then contains a pair of
subforms that describes each specimen specifically for certain criteria
(pathology and taphonomy). However, I've decided that I can save a lot of
time if the first record in the main form for each set of specimens describes
the whole set, or catalog number (e.g., color and degree of weathering are
generally uniform within a catalog number, although I need to maintain the
option of entering values as occasionally there is a specimen that stands in
stark contrast to the rest of the catalog number's specimens). So what I
need is an automatic fill for the 6 or 7 fields that will remain mostly
constant within the catalog number, based upon the first value entered under
that catalog number, but then can still be changed if the specimen is
different from the general description. Can this even be done?!
 
Hi, I'm new to Acces and self-taught, so please forgive my ignorance if my
question is muddled or uses imprecise terms.

I have a form that describes a specimen generally (type of specimen, side it
comes from, color, weathering, etc). This form then contains a pair of
subforms that describes each specimen specifically for certain criteria
(pathology and taphonomy). However, I've decided that I can save a lot of
time if the first record in the main form for each set of specimens describes
the whole set, or catalog number (e.g., color and degree of weathering are
generally uniform within a catalog number, although I need to maintain the
option of entering values as occasionally there is a specimen that stands in
stark contrast to the rest of the catalog number's specimens). So what I
need is an automatic fill for the 6 or 7 fields that will remain mostly
constant within the catalog number, based upon the first value entered under
that catalog number, but then can still be changed if the specimen is
different from the general description. Can this even be done?!

For each control on your form that you wish to carry over to the next
new record .....
If the field is NOT a Date datatype, code that control's AfterUpdate
event:

Me![ControlName].DefaultValue = """" & Me![ControlName] & """"

If the field is a Date datatype, then code that control's AfterUpdate
event:

Me![DateField].DefaultValue = "#" & Me![DateField] & "#"

You'll have to enter the value just once per session.
It will remain the same for each new record until changed.
 
Wow, Fred, thanks for the rapid and effective response-- that set the default
for each of the features which i want to carry over, and even I was able to
do it! One nuance, if I'm not pushing my luck-- is there any way to set the
default values for these fields ONLY if the prior field [element class] is
set to a certain value (e.g., "general skeletal" versus "cranial element",
"appendicular element" etc) like you can in a macro?

Thanks again for your help. I never would've worked that one out for
myself, no amtter how many sleepless nights I spent banging away at it! My
solo-flight capabilities end with the macros, it seems!

Thanks again.

fredg said:
Hi, I'm new to Acces and self-taught, so please forgive my ignorance if my
question is muddled or uses imprecise terms.

I have a form that describes a specimen generally (type of specimen, side it
comes from, color, weathering, etc). This form then contains a pair of
subforms that describes each specimen specifically for certain criteria
(pathology and taphonomy). However, I've decided that I can save a lot of
time if the first record in the main form for each set of specimens describes
the whole set, or catalog number (e.g., color and degree of weathering are
generally uniform within a catalog number, although I need to maintain the
option of entering values as occasionally there is a specimen that stands in
stark contrast to the rest of the catalog number's specimens). So what I
need is an automatic fill for the 6 or 7 fields that will remain mostly
constant within the catalog number, based upon the first value entered under
that catalog number, but then can still be changed if the specimen is
different from the general description. Can this even be done?!

For each control on your form that you wish to carry over to the next
new record .....
If the field is NOT a Date datatype, code that control's AfterUpdate
event:

Me![ControlName].DefaultValue = """" & Me![ControlName] & """"

If the field is a Date datatype, then code that control's AfterUpdate
event:

Me![DateField].DefaultValue = "#" & Me![DateField] & "#"

You'll have to enter the value just once per session.
It will remain the same for each new record until changed.
 
Back
Top