X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Parsing Name & Surname, Any Version    
post May 22 2020, 10:32 AM

Posts: 179
Joined: 1-June 10

On my form, I have a text box with name and surname (fldCombinedName) I have a small button to the side of the text box which when clicked parses the fldCombinedName to two separate text boxes (fldForename and fldSurname).

Here is the code that works fine;
Private Sub cmdParseCombinedName_Click()
Me!fldForename = Left([fldCombinedName], InStr(1, [fldCombinedName], " ") - 1)
Me!fldSurname = Right(Trim([fldCombinedName]), Len(Trim([fldCombinedName])) - InStr(1, [fldCombinedName], " "))

However, I want cater for the example (musical artists, therefore frequent) where fldCombinedName is a single word.
In those cases I want to have the code simply copy the fldCombined name to fldForename.

As it is I get "Error 5 Invalid procedure call or argument...." message.

How can I overcome this.

Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    7th July 2020 - 07:00 AM