Results 1 to 4 of 4
  1. #1
    bbv586 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    9

    Error code for my Queries and Forms for abbreviating initials

    I have a pretty specific question to see if anyone sees an error in the code from my database. I'm getting the error code below when I click on my "Open Jobs" button on my database. I believe the problem is somewhere in my code for the line in the second screenshot - SalesPerson2: Left([SalesPerson],1) & Left(Right(Trim([SalesPerson]),Len(Trim([SalesPerson]))-InStr(1,[SalesPerson]," ")),1)



    The purpose of that line is to abbreviate SalesPerson's name to their initials. Any help is appreciated.


    Click image for larger version. 

Name:	Pic01.jpg 
Views:	11 
Size:	113.5 KB 
ID:	33934

    Click image for larger version. 

Name:	Pic02.jpg 
Views:	11 
Size:	112.4 KB 
ID:	33935

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Try to replace Left(Right(Trim([SalesPerson]),Len(Trim([SalesPerson]))-InStr(1,[SalesPerson]," ")),1) with:
    Mid(Trim([SalesPerson]),InStr(Trim([SalesPerson])," "),1)
    Cheers,
    Vlad

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    The general scuttlebut is that this is a missing Reference issue.
    The purpose of that line is to abbreviate SalesPerson's name to their initials.
    Seems like a very convoluted way to get JS from Joe Smith...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Good practice table design is to separate the last name and first name into different fields. If so, getting initials is trivial.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 08-27-2014, 11:34 AM
  2. Replies: 9
    Last Post: 04-17-2013, 03:55 PM
  3. Replies: 6
    Last Post: 02-27-2013, 04:43 PM
  4. need a formula function Name to Initials
    By techexpressinc in forum Queries
    Replies: 2
    Last Post: 09-17-2010, 12:37 PM
  5. Replies: 4
    Last Post: 04-01-2009, 08:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums