View Full Version : Concatenate on Current Live Form


crhodus
04-19-2001, 12:51 PM
I have 3 forms open at the same time (Company, Project, Contact). On the Contact form, I have FIRST_NAME, LAST_NAME, and CONTACT_ID. CONTAC_ID is the Primary Key.
I have the default value for CONTACT_ID set to
=[Forms]![1_Company_Form]![COMPANY_NUMBER] & "|" & [Forms]![6_Project_Form]![PROJECT_NUMBER] so that when the Contact form is opened, the CONTACT_ID automatically contains the vaule from the Company form and the Project form combined (Example CONTACT_ID Value: 123|abc ).

Is there a way that I can also have the FIRST_NAME and LAST_NAME value that is entered into the Contact form automatically concatenated to the CONTACT_ID whenever they are entered into the form? (New CONTACT_ID Value: 123|abc|John|Doe )

AlanS
04-19-2001, 01:27 PM
You would probably want to be sure that this operation is only done once (rather than repeated each time the user changes the first name or last name field value), and that it is only done when those fields are finalized. So, I would try putting this code in the form's BeforeUpdate event:

CONTACT_ID = CONTACT_ID & "|" & FIRST_NAME & "|" & LAST_NAME