I am using Access 2007, and I have a database in which one field is likely to have the same value for several records (eg the Age field in a table of students). How can I set this field on a form so that when a new record is created, the Age field defaults to the value used in that field on the previous record (so that I don't have to keep entering the same data)?
Thanks in advance.
Robert
Hi
In my humble opinion, I think you should be storing the date of birth not the age (which changes)!!??
As usual there are many ways to do this I'm sure, but of the top of my head, this is one way
Declare a module level variable, say intAge
in the form before update event set this to intAge = age_control
in the form on current event set the age_control = intAge
IF it is a new record
ie If Me.NewRecord Then age_control = intAge
This may need tweeking, depending on how the form operates.
MTB