Results 1 to 6 of 6
  1. #1
    rmiell is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    5

    changing the apperance of a text field to mimic a MAC address

    I have a field in my table "serial number", text, which consists of mainly numbers & letters that make up a MAC address. When it was 1st entered, it was entered as just a string of numbers/letters with out any placeholders. "0004F2C7FCC8" I would like to display the data in a report so that is mimics the layout of a MAC address, that is "00:04:F2:C7:FC:C8".

    Any easy ways to handle this?

    Access 2007, Windows 8, novice

    Thanks in advance



    Rick Miell

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    How about something like this:
    Code:
    MAC_Add:LEFT([FieldName],2) & ":" & MID([FieldName],3,2) & ":" & MID([FieldName],5,2) & ":" & MID([FieldName],7,2) & ":" & MID([FieldName],9,2) & ":" & MID([FieldName],11,2)

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Or, using the Format function
    Code:
    Mac_Add: Format([MacAddress],"&&\:&&\:&&\:&&\:&&\:&&")
    Saved as..................Formatted
    0004F2C7FCC8 .....00:04:F2:C7:FC:C8

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Steve,

    Pretty cool! I didn't realize you could use the FORMAT function on Text fields (I have only ever used it on Numeric fields).

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I use the Format function in queries quite a lot for SSN and phone numbers.
    I store just the numbers (text field) and format in the query for reports. See Help for more options...

  6. #6
    rmiell is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    5
    Thanks for the replies.

    Rick Miell

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

Similar Threads

  1. Changing a text field output for a report.
    By Thompyt in forum Programming
    Replies: 12
    Last Post: 12-10-2014, 04:01 PM
  2. Mimic a label bound to ID field on form
    By BRZ-Ryan in forum Programming
    Replies: 10
    Last Post: 01-13-2014, 10:24 PM
  3. Replies: 10
    Last Post: 12-15-2013, 11:52 AM
  4. Replies: 4
    Last Post: 01-13-2013, 02:40 AM
  5. using google maps address into a text field
    By thanosgr in forum Programming
    Replies: 5
    Last Post: 04-26-2012, 03:39 PM

Tags for this Thread

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