form with default input from last record

  • Thread starter Thread starter mynndd
  • Start date Start date
M

mynndd

Guest
I know you can do it but don't remember how, would like to have form remember info from previous recomrd on some fields, unless changed. Not a set default, but one that holds the last input in that field as the default until it's changed. Help please.
 
Put this in the Exit Event of the last field in the form. When the new record is started the values from the last record will be the defaults for the new.

With CodeContextObject

        .Field1.DefaultValue = """" & .Field1 & """"
        .Field2.DefaultValue = """" & .Field2 & """"

End With
 
Welcome back to the world of the living Tal!
Exactly how do you manage the two faces of your personality BukTal?... Or are they just out of your control ? :p
 
thanks a million, i had the same question and Tal's solution worked perfectly. I would add only that if your field name has spaces in it you need these [] around the field name in the code. For example:


start code
*************************************
With CodeContextObject

.Field1.DefaultValue = """" & .Field1 & """"
.[Field 2].DefaultValue = """" & .[Field 2] & """"

End With
*************************************
end code

this board rocks

path
 

Users who are viewing this thread

Back
Top Bottom