'Create variables to hold first and last name ' and customer ID. Dim fName As String Dim lName As String Dim cID As String 'Assign the text in the LastName text box to ' the lName variable. lName = Forms!customers!LastName.Text 'You must set the focus to a text box before ' you can read its contents. Forms!customers!FirstName.SetFocus fName = Forms!customers!FirstName.Text 'Combine portions of the last and first names ' to create the customer ID. cID = UCase(Left(lName, 3) & Left(fName, 2)) 'Don't store the ID unless it is 5 characters long. ' (This would indicate both names not filled it.) If Len(cID) = 5 Then Forms!customers!CustomerID.SetFocus 'Don't change the ID if it has already been ' entered...perhaps it was changed manually. If Forms!customers!CustomerID.Text = "" Then Forms!customers!CustomerID = cID End If End If 'Set the focus where it would have gone naturally. Forms!customers!Address.SetFocus