Results 1 to 3 of 3
  1. #1
    everterra is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2014
    Location
    Gaia, Portugal
    Posts
    14

    Post How to format a table field for "year", only with 4 digits but enter only two?

    How to create a year field, only with 4 digits in a table and enter only two?




    To be able to work quickly, I want to enter only two digits, 13, and the field value in the table is shown as 2013.


    I'm trying this: In the table named DOCS I have a field, YEAR looking (lookup) in another table:


    I enter 13, but it must show the value in the 2nd column, 2013
    In a query or a form itīs easy, but in a table field (DOCS) how to get it?


    Can be used an Expression in the properties, Data Type> Calculated?



    It is possible to

    • create a query here?
    • or use the DLookup function?


    How?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I use input mask and have the '20' part actually saved in the record. I know Y3K is a long way off and Y2K wasn't really the major disaster everyone expected, but saving the 20 is just convenient and memory is cheap.

    Year is a reserved word in Access and reserved words should be avoided as field names.
    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
    everterra is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2014
    Location
    Gaia, Portugal
    Posts
    14
    Resolved: I created the YEAR field (named ANO), type number, and in the input mask I put "20" ##.
    Now I enter only 13 and turns to 2013.


    Thanks June7.
    Last edited by everterra; 04-19-2014 at 03:26 AM. Reason: Understood the purposed solution.

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

Similar Threads

  1. Replies: 5
    Last Post: 01-04-2017, 02:13 AM
  2. Replies: 5
    Last Post: 04-09-2014, 03:34 PM
  3. Replies: 5
    Last Post: 02-07-2014, 11:57 AM
  4. table field name "Year" causing Argument Not Optional
    By JosmithTwo in forum Programming
    Replies: 2
    Last Post: 09-26-2012, 08:01 PM
  5. ALTER TABLE does not set field "format"
    By GraeagleBill in forum Programming
    Replies: 5
    Last Post: 09-07-2012, 01:11 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