Hi,
One one of my forms i'm using the following code on the After Update event of one of my text boxes.
Me.SD_Knownas = Left$([SD_FirstName], InStr(1, [SD_FirstName], " ") - 1)
What i'm trying to do is pull the firstname from a string of text. For Example my name is Pete James the above ode returns Pete. Perfect..
The problem is.. when i enter a name that for example Pete i get a runtime error 5?
Is there away to make it see if there is one name in the box and use that or if more than one just return the first part.
Regards
Pete
One one of my forms i'm using the following code on the After Update event of one of my text boxes.
Me.SD_Knownas = Left$([SD_FirstName], InStr(1, [SD_FirstName], " ") - 1)
What i'm trying to do is pull the firstname from a string of text. For Example my name is Pete James the above ode returns Pete. Perfect..
The problem is.. when i enter a name that for example Pete i get a runtime error 5?
Is there away to make it see if there is one name in the box and use that or if more than one just return the first part.
Regards
Pete