473,659 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enter date as 12/01 and display it back as 12/2001 problem

Hi All,
In access97 I have an unbound textbox with the format property set to
'short date' and an input mask of 99/99. In the after update event of
the textbox I have code; me!textbox = format(me!textb ox, "mm/yyyy")

What I'm tring to do is let the user enter the month and two(2) digit
year and then display it back to them as a four(4) digit year. This
works fine up until 2001 then it screws up.
examples:
if I enter 11/99 it displays 11/1999
if I enter 10/80 it displays 10/1980
if I enter 11/00 it displays 11/2000

if I enter 11/01 it displays 11/2003?
if I enter 11/02 it displays 11/2003?

why?
thanks
bobh.
Nov 12 '05 #1
1 1866
11/01 is interpreted as November 1 of the current year.

11/99 cannot be November 99 of the current year, so Access takes another
interpretation.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Bob Hynes" <vu******@usexp ress.net> wrote in message
news:39******** *************** ***@posting.goo gle.com...
Hi All,
In access97 I have an unbound textbox with the format property set to
'short date' and an input mask of 99/99. In the after update event of
the textbox I have code; me!textbox = format(me!textb ox, "mm/yyyy")

What I'm tring to do is let the user enter the month and two(2) digit
year and then display it back to them as a four(4) digit year. This
works fine up until 2001 then it screws up.
examples:
if I enter 11/99 it displays 11/1999
if I enter 10/80 it displays 10/1980
if I enter 11/00 it displays 11/2000

if I enter 11/01 it displays 11/2003?
if I enter 11/02 it displays 11/2003?

why?
thanks
bobh.

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3178
by: Shlomi Schwartz | last post by:
Hi all, Why do I get the folowing date when creating it like so: var d = new Date(2003,9,2); Wed Oct 1 23:00:00 UTC+0200 2003 Isent it soposed to be:
7
4042
by: Thomas R. Hummel | last post by:
Hello all, I am trying to write a query that compares a member's enrollment period with the products that their group has had during that period (all members belong to a group and the products that the member has are based on that group). I need to get the date range for all products that the member had during their enrollment. Here are a few rules: - In the source table there are some group products that have two
6
9337
by: Franz | last post by:
Hy all, I have a problem with a date in javascript on firefox Browser. I use this javascript method: var dataNow=new Date(); var dd=dataNow.getDate(); var mm=dataNow.getMonth()+1; var yy=dataNow.getYear();
1
2998
by: sylvian stone | last post by:
Hi, I've used standard date functions in the past, but need to create something a little different, as I am working on an investment calculator. What I need to do is validate two dates, and check for a complete years. And a complete year is from day 1 until the proceeding day the following year. A couple of examples:
1
8785
by: Scott Dunham | last post by:
I'm trying to select records between 2 different times, but I can't seem to get Access to see anything other than the date. For instance, criteria "Between #11/12/2001 1:45:00 PM# and #11/12/2001 2:45:00 PM" returns all records on the 12th. Is there a trick here somewhere? The field is date/time format. Do I have to do something to split the date and time apart in order to get the filter to work right?
9
430
by: VJ | last post by:
I have a window were I display a bunch of Labels. A click event is attached for each label, when clicked it will display a edit box i.e textbox. If the enter key is pressed in the textbox I want to the foucs to shift to the next label in taborder and then fire the click event of that label and display a editbox. Here is what I tried..and its not working.. The current edit box has a key down event.. with code like this.. If e.KeyCode =...
6
3230
by: alexanderpope11 | last post by:
Hello, how do I write this SQL: I would like to check the Main table for invalid rows. An invalid row is: any row where the Start_date to stop_date range overlaps an invalid date in the Code table. For example, Row#2 is invalid because the Start_date-Stop_Date range overlaps 2 days in the code table where the code AA was not valid (12/30/2000 - 12/31/2000) Main Table
3
4488
by: Bob Sanderson | last post by:
I have a PHP web page which uses a HTML form. I would like to enter dates into the date fields using a JavaScript calendar, similar to the way phpMyAdmin does. Can anyone recommend a JavaScript that will do this? Also, how can I add a button to a form to enter a NULL. Thanks in advance.
0
937
by: Cyril044 | last post by:
Hey Guys! Im having a bit of a problem. Im using SQL server 2005 and in the table i have a date field but i used string instead of the datetime value. I want to generate a report where all the dates prior to the one the user enters will be displayed. My problem is that when i do a select statement to return all dates prior to the one entered it does not notice that there is a month and a year aswell and just compares the day. Like i will want to...
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.