Results 1 to 4 of 4
  1. #1
    emscaptvinny is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2015
    Posts
    4

    Question Last 5 digits of a SS# using "Right" function problem

    In a personnel info DB: I have a [Social Security#] field and a seperate field for [Last 5 digits of SS#] and a field called [Text102]. In the [Text102] field I have used the "Right" function to extract the last 5 digits and it displays it in the text102 box on the form without a problem but doesnt pass it to the field named [Last 5 digits of SS#] in the underlying table. I have tried putting the "Right" statement as the control source in both the [Text102] field and the [Last 5 digits of SS#] field but niether one ends up passing the result to the corresponding field in the table. Can anyone help me solve this problem?



    Currently, the "Right" function is located as the control source for the text102 field ie: =Right([Social Security#],5)

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by emscaptvinny View Post
    ...Currently, the "Right" function is located as the control source for the text102 field ie: =Right([Social Security#],5)...
    It looks, to me, like you are done! Why store, only, the last 5 in your table? You already have the last 5, along with the rest of the SS stored in the table. If you want to see, only, the last 5, employ the solution you posted.

    If you really, really, desire to update the table with the data in the unbound control, use SQL and the UPDATE operator or DAO. The problem with this is, when to do it. It probably does not belong in the form you are using to view a person's profile. It probably belongs on a form where the data is initially entered and validated.

  3. #3
    emscaptvinny is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2015
    Posts
    4

    Thumbs up

    Quote Originally Posted by ItsMe View Post
    It looks, to me, like you are done! Why store, only, the last 5 in your table? You already have the last 5, along with the rest of the SS stored in the table. If you want to see, only, the last 5, employ the solution you posted.

    If you really, really, desire to update the table with the data in the unbound control, use SQL and the UPDATE operator or DAO. The problem with this is, when to do it. It probably does not belong in the form you are using to view a person's profile. It probably belongs on a form where the data is initially entered and validated.
    Thanks. The results of the "last 5 digit" extraction is used in conjunction with a members hire date to determine seniority in the department. I just realized I could have avoided all this by putting this whole thing in a query that returns the seniority list (instead of placing it on the actual personnel info form and then doing the queries).

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Sometimes duplication of data is desirable. For instance, storing it in another table helps queries and updates. Glad you took into consideration an alias in a Query Object as a solution.

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

Similar Threads

  1. Replies: 7
    Last Post: 09-20-2014, 06:48 PM
  2. Unbound text box data type and "Delete" function
    By gaker10 in forum Programming
    Replies: 16
    Last Post: 06-13-2014, 10:46 AM
  3. Replies: 2
    Last Post: 04-19-2014, 02:42 AM
  4. Replies: 2
    Last Post: 11-04-2011, 02:45 AM
  5. Replies: 3
    Last Post: 04-10-2010, 10:22 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