Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2009
    Location
    Berkshire, UK
    Posts
    30

    Unanswered: Format for 4-digit year

    I want my form to allow users to enter a 4-digit year, with the default value of the current year.

    I presume that a Date format is not appropriate for this, so how do I get a Number format to display the current year?

    Mike

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    use a date format, but select the appropriate format mask (something like 'long date')
    or use a date/calendar control

    don't use a numeric format, unless you really really have to. chose a datatype that most closely matches your, and the data's requirement so dates in date/time, text in string/char/text, intergers in the appropriately sized integer type.... understand the difference between the various floating datatypes.. use decimal or currency as appropriate
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2009
    Location
    Berkshire, UK
    Posts
    30
    Quote Originally Posted by healdem View Post
    use a date format, but select the appropriate format mask (something like 'long date')
    I did try that, but entering "2010" results in "22 Jun 1905" because I presume that is 2010 days after 01 Jan 1900

  4. #4
    Join Date
    Nov 2009
    Location
    Berkshire, UK
    Posts
    30
    After some more playing, and with the data type set to Number and the default value for the form field set to = Format(Date(), "yyyy") I get the result I wanted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •