Combine two Form textbox fields prior to writing the record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

As a user enters a persons frmCustomer.FirstName and frmCustomer.LastName I
want to combine them together so that when the record is written to the
database a third field is created for the record. The third field is called
tblCustomer.CusKey
The result I want should be:

tblCustomer.CusKey tblCustomer.LastName tblCustomer.FirstName
JonesBob Jones Bob
 
That can be done, but shouldn't be. First of all using a natural key that
can be duplicated needs to be avoided. What happens when there are 2 (or
more) Bob Joneses? Second, you can create a compound index on the 2, but
will still have the first problem if you try to make it a unique index.
Third, the first rule of relational databases is not to use multiple values
in a field (1NF or First Normal Form). Relational database design is
dependent on Relational Set Theory from calculus. To work properly, it is
highly recommended that you follow the rules.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Arvin,

Thanks for the reply. I agree with the approach that you suggest, I tried
to make the example simple enough to explain. My problem is the programming,
I am simply stuck. I don't know how to do it. Can you help?

Thanks
 
To create a compound index, open the indexes dialog (In a table's design
view, click on View ... Indexes), type in a name for the index in the first
column, then add the fields to the middle column. You can have as many as 10
fields in an index.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top