In the hopes that walking through exactly what I'm experiencing, I'm including a snippet of screenshot that depicts how the form looks and what code runs behind as I proceed. With the design view added, you can see the control binding.
When I enter text in the "Family Name", the AfterUpdate gets control and the following code runs. As the code runs, I Msgbox the record ID to verify that a record has been created. After the code runs and the combo dropdown is selected, the newly entered text in the "Family Name" control becomes blank and the focus moves to the POBox field. If I enter a value there, another record is created. My intend, of course, is to populate a single record with all the values that would be entered in each of the controls. The code references record fields "FamilyID" and "FamilyName" correctly, leading me to believe erroneously that the new record had become the Current Record.
Code:
Private Sub tbFamilyName_AfterUpdate()
If bolNewFamily = True Then
If ParseFamilyName = False Then
MsgBox "Sorry, but you must enter a unique family name of the form:" & vbNewLine & _
"LastName,FirstName OR, if a Pseudo family is being established" & vbNewLine & _
"then just prefix the name of your choice with ""*-"". "
Exit Sub
End If
End If
MsgBox "FamilyID = " & FamilyID 'Did the autonumber "fire"
If bolPseudoFamily Then
If MsgBox("The addition of a new ""Pseudo"" family has been detected" & vbNewLine & vbNewLine & _
"If one chooses to associate this family with one of the" & vbNewLine & _
"established TMS Groups, it must be done at this juncture." & vbNewLine & vbNewLine & _
"Further, it must be understood that one cannot change the" & vbNewLine & _
"Group once the association is established, which occurs" & vbNewLine & _
"upon entry of the Head-of-Household.", vbOKCancel) = vbOK Then
Me.lblAssoc.Caption = "Select Desired Group:"
Me.lblAssoc.Visible = True
Me.cboGroups.Visible = True
Me.Repaint
Me.cboGroups.SetFocus
Me.cboGroups.Dropdown
bolShowGroups = True
End If
End If
End Sub
Private Function ParseFamilyName() As Boolean
Dim strName() As String
ParseFamilyName = False
If Left(FamilyName, 2) = "*-" Then 'New pseudo family name?
If Len(FamilyName) > 2 Then 'Make sure more than just the prefix
bolPseudoFamily = True 'Okay to proceed
ParseFamilyName = True
End If
Else
strName = Split([FamilyName], ",")
If UBound(strName) = 1 Then
strLName = strName(0)
strFName = strName(1)
FamilyName = strLName & "," & strFName
ParseFamilyName = True
End If
End If
End Function
Could Enter Key behavior on the "Family Name" when entered be causing another record to be created? The form's Cycle Property is already set to "Current Record", but still I wonder.