Hi Guys, can anyone see the wood here ? i can't see the wood for the trees
If a text box has got Joe Bloggs in it, i am trying to return Joe
If a text box has only got Joe in it, i am still trying to return Joe
If a text box has got Mr Bloggs in it, i am trying to return Mr Bloggs (Not got this far yet to add code that if the text box says Mr or Mrs so needs adding to what i have got here below)
Dim FullName as string, fName as String, sName as string
FullName = InStr(Me.txtClientName, " ")
If FullName <> "" Then
fName = Left(Me.txtClientName, FullName) 'Does return Joe
End If
If FullName = "" Then
fName = Left(Me.txtClientName, "") 'RETURNS NOTHING
End If