Creating new record in a table

M

MaRSMAN

Table Household fields are Household Of,Last,Sufix(ex."Sr."), First,Middle
when I enter the Last,Sufix,First,Middle I then want Household Of to be
automaticly filled with the "Last Sufix, First Middle" when I exit the table
or when I go to add another new record. If this is posible please give me
the correct expression. Household Of , is my Primary Key as it will be
unique with no duplicates allowed.
 
D

Douglas J. Steele

Are you saying you want to store the data redundantly, once as separate
fields and once combined? That's definitely not recommended.

Instead, keep the fields separate, and create a query with a computed field
that concatenates them together for display purposes. Use the query wherever
you would otherwise have used the table.
 
M

MaRSMAN

Yes that is what I want to do. Though this may not be recomended, It does
stop duplicate records from being added to the table andt this field
Household Of becomes my foreign key in many of my other tables. So if there
is the correct expression and syntax for doing this. What would it be.
 
J

John W. Vinson

Yes that is what I want to do. Though this may not be recomended, It does
stop duplicate records from being added to the table andt this field
Household Of becomes my foreign key in many of my other tables. So if there
is the correct expression and syntax for doing this. What would it be.

Again... YOU REALLY DON'T WANT TO DO THIS.

Names are *NOT* unique. I once worked with Dr. Lawrence David Wise, Ph.D. and
his colleague, Dr. Lawrence David Wise, Ph.D.; I know three people name Fred
Brown.

It will *not* prevent invalid duplicates from being added to the database, if
one gets entered with an abbreviated or missing middle name.

It *will* prevent valid records from being added to the database (unless the
data entry person gets around the restriction as above) if you happen to have
two records for people who happen to share a name.

You can *check* (not prevent) the addition of duplicates by using the Form's
BeforeUpdate event to look up names in the form's recordsource query and
alerting the data entry person of the duplication.


John W. Vinson [MVP]
 
T

Tom Wimpernark

im not sure I agree with this.

in SQL Server you can use calculated fields-- and they're readily available
whenever you want them-- just query the field from the table

sounds to me like you need to go back to architecture school and learn how
to choose a decent database
 
G

George Hepworth

Aaron Kem.pf is posting under a new alias.

Tom Wimpernark said:
im not sure I agree with this.

in SQL Server you can use calculated fields-- and they're readily
available whenever you want them-- just query the field from the table

sounds to me like you need to go back to architecture school and learn how
to choose a decent database
 
Top