Auto update 3rd field in entry form from 1st 2 entry fields

G

Guest

I want entries made to two fields: FirstName, LastName,
and have a 3rd field called "FullName" automatically populate with the
combination of FirstName & " " & LastName.
I want this 3rd field to be the Primary Key for the table this is
populating, so this needs to happen while the record is still open.
I've tried events & defaults and can't make it work.
Help!!
Thanks, Viv
 
D

Douglas J. Steele

That's definitely not recommended. You'd be storing data redundantly.

On top of that, Names are seldom a good choice for primary keys: I know two
Bob Weirs who worked in the same department (and both are married to
Lindas).

Ignoring the primary key part for now, you should only store the FirstName
and LastName in the table. If you need FullName for display purposes, create
a query that has a computed field FullName: FirstName & " " & LastName, and
use the query wherever you would otherwise have used the table.
 
G

Guest

You are absolutely right! I got so hung up on not being able to make the
automatic update work, I just didn't think about it!
I know the names are not a good primary key and have been wanting to update
the database to a new key system, guess now would be as good a time as any!
Thanks again,
Viv
 

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