Results 1 to 4 of 4
  1. #1
    Khatuaaccess is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jul 2016
    Posts
    13

    Reverse the display order of names

    Hi,
    I have a filed name called "Name" where I values like "Smith, Will". I now have a need to display the firstname first then
    surname ( ex - will smith). Is there a way of reversing the order that the column "name" is
    displayed and update it in access table.

    Thanks
    Prasanta


  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    You should store data in atomic form. That is,

    tblPerson
    FirstName......John
    LastName......Smith
    other info

    You can always concatenate atomic values into other displays when necessary

    LastName & ", " & FirstName produces Smith, John

    From Michael Hernandez

    Elements of the Ideal Field
    --------------------------------------
    It represents a characteristic of the subject of the table.
    It contains only a single value
    It cannot be deconstructed into smaller components
    It does not contain a calculated or concatenated value
    It is unique within the entire database structure
    It retains all of its characteristics if it appears in more than one table.

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The main question is - is the name always in that format? If so, then you can take the last name as all characters before the comma and the first name as all characters after the comma. This is dependent on the comma always being there and in that spot.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    vFirstLastName = Trim(Mid(Me.Name, InStr(Me.Name, ",") + 1)) & " " & Left(Me.Name, InStr(Me.Name, ",") - 1)

    fyi you should not use Name as a field name, use FirstName or FName, LastName, FullName, etc. Also as aytee asked, if the format does not always have the comma after the last name, then the line above will not always work.

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

Similar Threads

  1. Replies: 8
    Last Post: 06-26-2016, 01:39 PM
  2. Text box to display names.
    By Homegrownandy in forum Access
    Replies: 8
    Last Post: 08-27-2015, 08:24 AM
  3. Replies: 2
    Last Post: 05-13-2015, 03:20 PM
  4. Display Names horizontal instead of vertical
    By bradleyg in forum Reports
    Replies: 2
    Last Post: 10-03-2014, 12:39 PM
  5. Combobox display order
    By Duncan in forum Queries
    Replies: 91
    Last Post: 09-01-2011, 05:12 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