Results 1 to 6 of 6
  • Thread Tools
  1. Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Entering just the year in a text box on a form (2000)

    I'd like to input just the year in the Data text box on the CostiAnnuali form of the attached mdb.
    If I type e.g. "2002" (without the quotes) a message box pops up saying, "The value you entered isn't valid for this field. For example, you may have entered text in a numeric field or a number that is larger than the FieldSize setting permits". I've already set the Data Type of the field that's the text box's control source to "Date/Time".
    How can I do it?
    Attached Files Attached Files
    • File Type: zip T.zip (53.6 KB, 1 views)

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. 3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Entering just the year in a text box on a form (2000)

    Changing the data type to number will allow you to enter the year.

  4. Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Entering just the year in a text box on a form (2000)

    Thanks Bill,
    Is there any way to achieve it without changing the data type?

  5. 3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Entering just the year in a text box on a form (2000)

    Giorgio: Not to my knowledge, but then, my knowledge is limited. I tried all the combinations I could think of and changing the data type was the only one that worked.

  6. Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,466
    Thanks
    2
    Thanked 39 Times in 39 Posts

    Re: Entering just the year in a text box on a form (2000)

    Bill is correct - a date/time field must be exactly that - an integer portion which represents the number of day since 31 Dec 1899, and a decimal portion which represents the time from midnight as a portion of a day. It is possible to use a format which only displays the year and enter something like 1/1/2002 in the date field as an alternative to changing the data type.
    Wendell

  7. 5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Entering just the year in a text box on a form (2000)

    I had a similar problem when I tried to enter the month into a field. I found the solution was to enter the first day of the month as a date from a combo box which had a hidden column containing the first day of every month and a visible column containing the name of each month. The advantage of using the the first day of the month is that you can take one day off and it gives you the last day of the preceding month, from which you can extract the name of the preceding month which I found useful.

    I would have thought you could apply the same idea to years, using the first day of the year in a combo list.

Posting Permissions

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