Repeating field information on form

  • Thread starter Thread starter vtj
  • Start date Start date
V

vtj

I am entering new records to a dataset via forms. A couple of the fields in
the records will be the same from record to record. I can set the default
value to be ‘x’ for those. Most of the rest of the fields will be repeated
from the previous entry with some changes. What I want to do is have the
information in a field to repeat from the previous form (record?) but allow
it change on any given record. E.g. the value will default to the previous
record same field value but could still be changed before the record is
saved. From that point I want the new value to repeat on the next record. I
am sure someone has already solved this but have been unsuccessful in finding
it. Thanks for your help.
 
vtj said:
I am entering new records to a dataset via forms. A couple of the fields in
the records will be the same from record to record. I can set the default
value to be ‘x’ for those. Most of the rest of the fields will be repeated
from the previous entry with some changes. What I want to do is have the
information in a field to repeat from the previous form (record?) but allow
it change on any given record. E.g. the value will default to the previous
record same field value but could still be changed before the record is
saved.


For each text box that you want to "repeat", use code in the
text box's AfterUpdate to set the text box's DefaultValue
property:

Me.[text box].DefaultValue = """" & Me.[text box] & """"

For some (strange?) combinations of date settings in
Windows, you may need to use this for text boxes bound to a
date field:

Me.[text box].DefaultValue = Format(Me.[text
box],"\#yyyy-m-d\#")
 
Back
Top