Results 1 to 5 of 5
  1. #1
    clownfish1980m is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Location
    San Antonio TX
    Posts
    9

    Last 4 of SSN in Field


    I created a database is Access 2007 with the following code. I have a field to put the SSN in and another field to have only the last 4 show up. When I produce a report only the last 4 numbers are used. The code is under "Control Source" , =Right([SSN],4). It doesn't work in 2010. Not sure why or how to fix it. Thanks Ken

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What does "doesn't work" mean - error message, wrong results, nothing happens?

    Are you saying the expression in ControlSource is not calculating?

    Why don't you do that calc in query then bind textbox to the constructed field?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    ..."It doesn't work in 2010".... isn't much to go on.
    In what way does it not work. Do you get the wrong data, no data, an error message? Where are you using the expression?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    clownfish1980m is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Location
    San Antonio TX
    Posts
    9
    It gives me #Name?. It worked in 2007 version but not in 2010. Does VBA work in 2010? Ken

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Certainly VBA works in 2010. But what does VBA have to do with expression in query or textbox? Did you try my suggestion to calculate in query?

    I have found that if a report textbox is not bound to a field, referencing that field in an expression can fail. I know, weird, but that is what I experienced.

    Also, if the textbox is named SSN and its ControlSource has expression referencing SSN, that is circular reference and will error.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 6
    Last Post: 06-26-2015, 08:55 PM
  2. Replies: 17
    Last Post: 03-16-2014, 10:52 PM
  3. Replies: 3
    Last Post: 12-27-2013, 02:33 PM
  4. Replies: 1
    Last Post: 03-03-2012, 10:17 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