Repeating field information on form

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.
 
M

Marshall Barton

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\#")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top