Try this ....
Code:
Private Sub Details_AfterUpdate()
With Me
If Not IsNull(.Details) Then
.DateTaken = Mid(.Details, InStr(.Details, ";") - 10, 10)
.City = Mid(.Details, InStr(.Details, "port of ") + 8, InStrRev(.Details, "; ") - InStr(.Details, "port of ") + 9)
.City = Left(.City, (InStr(.City, ",") - 1))
Dim strText As String
'get first part of string
If InStr(.Details, "EA;") > 0 Then
strText = Left(.Details, InStr(.Details, "; EA;") - 1)
ElseIf InStr(.Details, "TB") > 0 Then
strText = Left(.Details, InStr(.Details, "; TB;") - 1)
End If
'now remove unwanted section at start
strText = Mid(strText, InStrRev(strText, "; ") + 1)
'trim to remove spaces
.Quantity = Trim(strText)
....
End With
...
End Sub