Try this: I renamed text19 to txtSearch. I also assumed that if not found you want to enter a new record.
Commented out 'ON ERROR RESUME NEXT'. When debugging, that will make it almost impossible to spot ANY kind of error, and in production it's also a very bad idea.
Code:
Private Sub txtSearch_AfterUpdate()
Dim strFilter As String
Dim sSearch As String
'On Error Resume Next
If Me.txtSearch <> "" Then
sSearch = "'*" & Replace(Me.txtSearch, "'", "''") & "*'"
strFilter = "[Personnel-unit] Like " & sSearch & " OR [Personnel_Surname] Like " & sSearch & " OR [Personnel_L6] Like " & sSearch
Me.Filter = strFilter
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
If Me.Recordset.RecordCount = 0 Then
If MsgBox("Search not found, Enter new record?", vbInformation + vbYesNo, " N E W R E C O R D ? ") = vbNo Then
Me.FilterOn = False
txtSearch = Null
Exit Sub
End If
Me.FilterOn = False
DoCmd.GoToRecord , , acNewRec
Exit Sub
End If
' Me.Filter = "" 'new line of code
' Me.FilterOn = False 'new line of code
' Me.txtSearch.SetFocus 'new line of code
' Me.txtSearch = "" 'new line of code
' Exit Sub 'new line of code
' End If 'new line of code
With Me.txtSearch
.SetFocus
.SelStart = Len(Me.txtSearch)
End With
End Sub