Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2002
    Posts
    20

    Wink Unanswered: first last name button

    Hello,
    I am redoing some of my main data and seperating the Customer information into first and last name and then street address in seperate fields.

    Right now, I have the field [CustomerName], I'm trying to build a button that, when clicked, will automatically put the first and last name into the corresponding fields:

    [CustomerFirstName]
    [CustomerLastName]

    In a report in the past, I've used the stock code:
    Trim(Left([CustomerName],InStr(1,[CustomerName]," ")-1

    and

    Trim(Right([CustomerName],InStr(1,[CustomerName]," ")-2

    but I am having difficulty with the syntax in programming a button to assign these values to new field values.

    Thanks in advance for any assitance or advice!

  2. #2
    Join Date
    Feb 2002
    Posts
    64
    Here's what I'd do:

    [CustomerLastName]=Right([CustomerName], Len([CustomerName]) - (InStr([CustomerName], " ")))

    [CustomerFirstName]=Left([CustomerName], (InStr([CustomerName], " ") - 1))

    Hope this helps!

  3. #3
    Join Date
    Mar 2002
    Posts
    20
    Hi TJoy,

    Thanks for the fix -- I got it working!

    Thanks again!
    Jon

  4. #4
    Join Date
    Feb 2002
    Posts
    64
    Cool, glad to help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •