473,803 Members | 3,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access date validation driving me nuts

Hi
I have a very simple problem indeed, but I am unable to solve it. I
am inputing a short date into an unbound text box with a short date
input mask. I am in the UK so my date format is dd/mm/yyyy. Everything
works superbly well with one exception.
Example: Suppose I accidentally keyed in 04/13/2005 the program
assumes that I meant 13/04/2005 and swaps the day and the month field
around without displaying an error, so the date is incorrectly
processed as 13/04/2005. How do I stop this please?

Regards
Carriolan
Dec 4 '05 #1
11 6204

<carriolan@> schreef in bericht news:n9******** *************** *********@4ax.c om...
Hi
I have a very simple problem indeed, but I am unable to solve it. I
am inputing a short date into an unbound text box with a short date
input mask. I am in the UK so my date format is dd/mm/yyyy. Everything
works superbly well with one exception.
Example: Suppose I accidentally keyed in 04/13/2005 the program
assumes that I meant 13/04/2005 and swaps the day and the month field
around without displaying an error, so the date is incorrectly
processed as 13/04/2005. How do I stop this please?

Regards
Carriolan


Hi Carriolan,
I don't think you can stop Access from trying to be a intelligent program. ;-)
Since there is NO month 13 Access guesses you made a mistake.
AFAIK you can not stop this behaviour.
You can however check the date yourself (before update event) and present a nice messagebox to the user.
Let us know if you need more help on this.

Arno R
Dec 4 '05 #2
How about wring some vba to check each portion of the date?

Split the string based on location of / or - into an array then process
the array, making sure that month is between 1 and 12. If it isn't
give error msg.

Dec 4 '05 #3
Hi
I found auto correct was set to 'yes'. Now this gets me part way
there. It prevents the date from being switched around, but it still
does not trap the error 04/15/2005. This is really strange as I am
using a default date of today which comes up in dd/mm/yyyy format. It
appears to allow both dd/mm/yyyy and mm/dd/yyyy formats - how do I
stop this please?

Regards
Carriolan
Dec 4 '05 #4
Hi
I found auto correct was set to 'yes'. Now this gets me part way
there. It prevents the date from being switched around, but it still
does not trap the error 04/15/2005. This is really strange as I am
using a default date of today which comes up in dd/mm/yyyy format. It
appears to allow both dd/mm/yyyy and mm/dd/yyyy formats - how do I
stop this please?

Regards
CarriolanOn Sun, 4 Dec 2005 23:58:37 +0100, "Arno R"
<ar***********@ tiscali.nl> wrote:

<carriolan@> schreef in bericht news:n9******** *************** *********@4ax.c om...
Hi
I have a very simple problem indeed, but I am unable to solve it. I
am inputing a short date into an unbound text box with a short date
input mask. I am in the UK so my date format is dd/mm/yyyy. Everything
works superbly well with one exception.
Example: Suppose I accidentally keyed in 04/13/2005 the program
assumes that I meant 13/04/2005 and swaps the day and the month field
around without displaying an error, so the date is incorrectly
processed as 13/04/2005. How do I stop this please?

Regards
Carriolan


Hi Carriolan,
I don't think you can stop Access from trying to be a intelligent program. ;-)
Since there is NO month 13 Access guesses you made a mistake.
AFAIK you can not stop this behaviour.
You can however check the date yourself (before update event) and present a nice messagebox to the user.
Let us know if you need more help on this.

Arno R

Dec 4 '05 #5
Many developers do not permit the direct entry of a date because of the
difficilties you describe. They use some form of a pop-up calendar and
a click on date method which populates the text field. There are many
pop-up calendars and a google search of this newsgroup is likely to
locate some good ones.
You can format the text box as something like d-mmm-yyyy which may give
you something like 4-dec-2005, but when you set the focus to the
control, it's likely the date will show in your regional settings
format, in my case, 2005-12-04.
On the net, one rarely sees the direct entry of a date being allowed. A
common solution seems to be three combo boxes, one for year, one for
month (names rather than numbers) and day. This of course, requires
some coding to get the date from the three combo boxes.

Dec 4 '05 #6
"Lyle Fairfield" <ly***********@ aim.com> wrote
Many developers do not permit the direct entry of a date because of the
difficilties you describe. They use some form of a pop-up calendar and
a click on date method which populates the text field. There are many
pop-up calendars and a google search of this newsgroup is likely to
locate some good ones.
Two calendar-style date pickers, from knowledgeable sources, may be found at
Stephen Lebans' site, http://www.lebans.com and Drew Wutka's site,
http://www.wolfwares.com. There are many others that can be found, as Lyle
states, by Googling. Both of these, IIRC, are done entirely with native
Access objects, so do not require distributing an ActiveX control with your
database.
On the net, one rarely sees the direct entry of a date being allowed. A
common solution seems to be three combo boxes, one for year, one for
month (names rather than numbers) and day. This of course, requires
some coding to get the date from the three combo boxes.


And, it seems hardly worth the trouble, considering the wide availability of
easy-to-use date pickers where experienced developers have already done the
"heavy lifting".

Larry Linson
Microsoft Access MVP
Dec 5 '05 #7
Hi Larry
I think you have it. Custom and practice dictate that I should not
allow direct date entry into a date field. I have one question
however. I use Access 2003, which has a calendar control. Is there a
catch to using this, if I am going to ditribute the app to 3rd
parties?

Regards
Carriolan

On Mon, 05 Dec 2005 04:17:24 GMT, "Larry Linson"
<bo*****@localh ost.not> wrote:
"Lyle Fairfield" <ly***********@ aim.com> wrote
Many developers do not permit the direct entry of a date because of the
difficilties you describe. They use some form of a pop-up calendar and
a click on date method which populates the text field. There are many
pop-up calendars and a google search of this newsgroup is likely to
locate some good ones.


Two calendar-style date pickers, from knowledgeable sources, may be found at
Stephen Lebans' site, http://www.lebans.com and Drew Wutka's site,
http://www.wolfwares.com. There are many others that can be found, as Lyle
states, by Googling. Both of these, IIRC, are done entirely with native
Access objects, so do not require distributing an ActiveX control with your
database.
On the net, one rarely sees the direct entry of a date being allowed. A
common solution seems to be three combo boxes, one for year, one for
month (names rather than numbers) and day. This of course, requires
some coding to get the date from the three combo boxes.


And, it seems hardly worth the trouble, considering the wide availability of
easy-to-use date pickers where experienced developers have already done the
"heavy lifting".

Larry Linson
Microsoft Access MVP

Dec 5 '05 #8
Hi Lyle
This is v. good advice - thanks.
Regards
Carriolan
On 4 Dec 2005 15:48:37 -0800, "Lyle Fairfield" <ly***********@ aim.com>
wrote:
Many developers do not permit the direct entry of a date because of the
difficilties you describe. They use some form of a pop-up calendar and
a click on date method which populates the text field. There are many
pop-up calendars and a google search of this newsgroup is likely to
locate some good ones.
You can format the text box as something like d-mmm-yyyy which may give
you something like 4-dec-2005, but when you set the focus to the
control, it's likely the date will show in your regional settings
format, in my case, 2005-12-04.
On the net, one rarely sees the direct entry of a date being allowed. A
common solution seems to be three combo boxes, one for year, one for
month (names rather than numbers) and day. This of course, requires
some coding to get the date from the three combo boxes.

Dec 5 '05 #9

<carriolan@> schreef in bericht news:4i******** *************** *********@4ax.c om...
Hi Larry
I think you have it. Custom and practice dictate that I should not
allow direct date entry into a date field. I have one question
however. I use Access 2003, which has a calendar control. Is there a
catch to using this, if I am going to ditribute the app to 3rd
parties?


IMO it's better to use this on or another not-activeX one:
http://allenbrowne.com/ser-51.html

Arno R
Dec 5 '05 #10

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

Similar topics

5
5137
by: S.Patten | last post by:
Hi, I have a problem with updating a datetime column, When I try to change the Column from VB I get "Incorrect syntax near '942'" returned from '942' is the unique key column value However if I update any other column the syntax is fine
1
5590
by: Darren Lew | last post by:
Hi there, I have this problem which is really driving me nuts for a couple of days. Glad if any help or suggestion is given Javascript will give me a pop-up error "Access is denied" when i try to load a simple xml file, which is in the server machine itself. The script is within a JSP page running apache tom-cat. I am running it with IE6 from an windows administrative acc straight on the server so there shouldn't be any access prob.
14
2470
by: Crimsonwingz | last post by:
Need to calculate a sum based on a number of factors over a period of years. I can use formula ^x for some of it, but need totals to carry over in the sum and have only been able to do this thus far with a loop in a form. Basically, I have key sums Current savings Current Salary Current deposit amount
1
2851
by: TN Bella | last post by:
Hello, I was looking through the older posts for a solution to this problem, but I am still confused on how to fix my problem. There are two dates on my form, one (txtInvDate) is entered by the user and has a validator (reDate) attached for specific dates that can be entered. The second date (txtRptDate) is another textbox that is filled with current date, that can not be changed by the user. The date (txtRptDate) that cannot be changed...
4
1660
by: trond | last post by:
Hello all, Before I start I'd like to point out that I am a complete novice when it comes to asp.net - My background is in network and operating systems, and although I have been doing a bit of hobby programming in vb.net and web programming in asp/vbscript in the past, I am pretty much a beginner at asp.net. What I'm trying to do, is to take the "PersonalHomePage" starter kit that MS supplies with VS2005 and tweak it a bit, to make it...
1
5485
by: Ray Nimmo | last post by:
This is driving me nuts, been at it now for the last week, anyone any ideas on wher im going wrong? using a list box pipeLB and a date/time picker pDate, im trying to populate the list box with the rows from the database where the date equals the one selected on the date/time picker. This should happen when i click the button showData. my database is called PressureReadings and the table inside it is called Pipe1Readings, with columns...
7
1842
by: Silvergun | last post by:
Sorry if this is a little basic, but I'm a real newbie with Access, and this is driving me crazy. What I'm trying to do is use the Count function in such a way that I can get it to return values based on other values. Specifically, I have a table that lists a number of gaming devices distributed between three locations. Each of these has its own unique serial number which I'm using as the primary key , and then an ID number field which tells...
1
1552
by: tulikapuri | last post by:
Friends , i want to chart the data from report for on daily, weekly and monthly basis and i have three variable i.e. time , date and Moisture. Can someone guide me how to arroach this issue, its simply driving me nuts.
7
2212
jinalpatel
by: jinalpatel | last post by:
I have two tables Mainfirm and Subfirm. I have everything ready. Now I am entering validation rules like as below in my form fields to protect the tables from bad data. But when I try to enter something wrong, it gives me error and it sticks to that error message,. It does not let me go forward. Is Null OR Not Like "**" Is Null OR Not Like "**" Is Null OR Not Like "**" Also, I tried to enter validation rules to the table itself instead of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
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...
0
9119
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
7600
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
5496
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
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4274
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
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.