Results 1 to 7 of 7
  1. #1
    txdave36 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2009
    Posts
    2

    Please Help, How Do I Format this Data?

    Hey guys,



    I have designed report in Access that prints a person's SSN number as 333-33-3333. I would like my report to only show the last 4 digits on the social.

    Is there a way to format this directly from the report design? The SSN is a database field in one of my Access tables.

  2. #2
    raskew is offline Novice
    Windows XP Access 97
    Join Date
    Sep 2009
    Posts
    2
    Hi -

    Try something like this (example from debug/immediate window)

    Code:
    x = "123-45-6789"
    y = "*******" & right(x, 4)
    ? y
    *******6789
    HTH - Bob

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Welcome Bob,

    Glad you found the place. We can use your excellent assistance.

  4. #4
    raskew is offline Novice
    Windows XP Access 97
    Join Date
    Sep 2009
    Posts
    2
    Hi Allan -

    It's amazing. Been doing this for how many years? Just now, within the past couple of days, discovered this site.

    Best Wishes - Bob

  5. #5
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Hi Bob, I was the same, however you do come across double postings both here and in AWP.

    David

  6. #6
    txdave36 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2009
    Posts
    2
    Quote Originally Posted by raskew View Post
    Hi -

    Try something like this (example from debug/immediate window)

    Code:
    x = "123-45-6789"
    y = "*******" & right(x, 4)
    ? y
    *******6789
    HTH - Bob

    Sorry, I am a bit green with Access. Where would i type this in?

    I've been researching this request all day, and I found this function:

    =RIGHT(SSN,4).

    I have to enter it into the control source for a text box on my report. Unfortunately, Access complains with a compile error when I try to enter in the function.

    I don't get it. The syntax is correct. Here is a screenshot of the error:



    Any suggestions?

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try: =Right([SSN],4)
    If that does not work then you might have a bogus MISSING reference.

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

Similar Threads

  1. Background Format
    By maysamab in forum Reports
    Replies: 7
    Last Post: 04-06-2009, 10:38 AM
  2. Format / Autoformat / Sandstone Help.
    By caljohn527 in forum Database Design
    Replies: 0
    Last Post: 10-30-2008, 05:51 PM
  3. Text Box Format
    By Scott in forum Forms
    Replies: 0
    Last Post: 01-09-2008, 11:13 PM
  4. Date Format
    By wasim_sono in forum Forms
    Replies: 2
    Last Post: 08-15-2006, 01:20 AM
  5. Date Format
    By St3ph3n in forum Access
    Replies: 4
    Last Post: 03-09-2006, 11:23 AM

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