D
Douglas J. Steele
Realistically, you should never store calculated values. You're trying to
store 2 pieces of information in a single field (which is a violation of
database normalization principles), plus (if you keep the other 2 values)
you're storing information redundantly. In addition, having a key based on
name isn't a good idea (What happens if you have also have Paul Mitchinson
as a customer? What happens if Jane Miller gets married and changes her name
to Jane Smith?
If you're still determined to do it, you'd have to put the calculation in
the form's BeforeInsert event so that it calculates the key before inserting
the record into the table. There's nothing you can do at the table level.
store 2 pieces of information in a single field (which is a violation of
database normalization principles), plus (if you keep the other 2 values)
you're storing information redundantly. In addition, having a key based on
name isn't a good idea (What happens if you have also have Paul Mitchinson
as a customer? What happens if Jane Miller gets married and changes her name
to Jane Smith?
If you're still determined to do it, you'd have to put the calculation in
the form's BeforeInsert event so that it calculates the key before inserting
the record into the table. There's nothing you can do at the table level.