How can i copy part of a record in a field to another field in same form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neelsfer
    Contributor
    • Oct 2010
    • 547

    How can i copy part of a record in a field to another field in same form

    I have a 13 digit Identity number ie 6302185149081 in the IdNo field. In the same table of this form, is a birthdate field.
    I need to copy the above Id number in the following format to the Birthdate field dd/mm/yyyy = 18/02/1963
    is this possible?
    pls help
  • dsatino
    Contributor
    • May 2010
    • 393

    #2
    go here and check out the string functions.
    For easy reference, we have provided a list of all Microsoft Access functions sorted into categories such as string, numeric/mathematical, date/time, advanced/logical, domain aggregate, data type conversion, group by, and file/directory functions.


    The Mid() function is probably the best way to extract what you need.

    Comment

    • neelsfer
      Contributor
      • Oct 2010
      • 547

      #3
      I used =Trim(Left([idNo],Len([IdNo])-7))
      and got 630218
      I need to swop it around to 18/02/1963
      any suggestions?

      Comment

      • dsatino
        Contributor
        • May 2010
        • 393

        #4
        Code:
        mid([idno],5,2) & "/" & mid([idno],3,2) & "/" & mid([idno],1,2)

        Comment

        • neelsfer
          Contributor
          • Oct 2010
          • 547

          #5
          thx dsatino it works

          Comment

          Working...