Insert into table

Posted on 2013-10-31
Last Modified: 2013-11-01


I would like to concatenate the first name, last name and DOB and insert the concatenation in Unique_ID field in Cust_tbl

what is the easiest way to do this if I am using a form to update the table.
Question by:Eddy2010
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 70

Expert Comment

ID: 39615790
add the following to the AfterUpdate event on the First_name, Last_name and DOB text boxes on the form:

me.UniqueID = me.First_Name & me.Last_name+ & me.DOB
LVL 70

Accepted Solution

KCTS earned 500 total points
ID: 39615792
opps a + crept in...

me.UniqueID = me.First_Name & me.Last_name & me.DOB
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39615800
place this codes in your form module

Option Compare Database
Option Explicit

Private Sub First_Name_AfterUpdate()
End Sub
Private Sub Last_Name_AfterUpdate()
End Sub
Private Sub DOB_AfterUpdate()
End Sub

Sub UpdateUniqueID()
Me.Unique_ID = Me.First_Name & Me.Last_Name & Me.DOB
End Sub
LVL 61

Expert Comment

ID: 39615827
In general you should use an auto number rather than personal info for a field like this.

The concatenated string can be derived at any time for display on forms or reports without needing to be stored as another field in your table.

Also, an autonumber is meaningless to the end user.  It can be used behind the scenes as a linking ID when creating relationships in your data, but you won't run across issues that more personal ID might cause when people get married, divorced or otherwise change meaningful personal data.
LVL 61

Expert Comment

ID: 39616255
As a somewhat related aside, a continuing issue that Experts-Exchange has is that members cannot change their usernames, which is possible on other sites.  The reason for this is that the original developers used the username as a primary key rather than using a generic, meaningless ID such as an autonumber.  The fact that you can't change usernames is clearly worded in the membership agreement that everyone diligently reads when joining ...  :-) ..., but it still occasionally comes up as a problem when users decide that they really shouldn't have used their full name or other sensitive info  as their username.

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question