473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I have the doubt in date format

hi everybody, Now im doing one project.In that I have to insert the Date Of Birth field into the db table.For that, if anybody enter the DOB field,I have to check whether it is in the format of "DD/MM/YYYY" or not.I have written the code for that is If text1.text<>Format$(DD/MM/YYYY) Then
Msgbox"DOB Should Be The Format Of DD/MM/YYYY"
But it hasn't succeeded. So kindly reply me anyone quickly.
Jan 29 '07 #1
6 1147
Dear sreekandan,
i advice to use date fields in dd/MMM/yyyy format.....
because here lots of chance to make mistake in day and month positions
Jan 29 '07 #2
Dear sreekandan,
i advice to use date fields in dd/MMM/yyyy format.....
because here lots of chance to make mistake in day and month positions
i tried with that code.But i couldn't get the right output.So kindly anyone reply me.
Jan 29 '07 #3
Killer42
8,435 Expert 8TB
i tried with that code.But i couldn't get the right output.So kindly anyone reply me.
One thing you could try is If Not IsDate(text1.text) Then...

Of course, one problem you may run across in such cases is people mixing up the month and the day. That's where using a non-numeric month can be useful. For example, 01/02/2003 is quite ambiguous, where "01 FEB 2003" is much harder to misinterpet.

Another option is to use something like a Calendar or DateTimePicker or Masked Edit control, which only allows the user to enter a valid format.
Jan 30 '07 #4
One thing you could try is If Not IsDate(text1.text) Then...

Of course, one problem you may run across in such cases is people mixing up the month and the day. That's where using a non-numeric month can be useful. For example, 01/02/2003 is quite ambiguous, where "01 FEB 2003" is much harder to misinterpet.

Another option is to use something like a Calendar or DateTimePicker or Masked Edit control, which only allows the user to enter a valid format.
thanks.I tried with that code.So i got the proper output that what am i thought.
Jan 30 '07 #5
One thing you could try is If Not IsDate(text1.text) Then...

Of course, one problem you may run across in such cases is people mixing up the month and the day. That's where using a non-numeric month can be useful. For example, 01/02/2003 is quite ambiguous, where "01 FEB 2003" is much harder to misinterpet.

Another option is to use something like a Calendar or DateTimePicker or Masked Edit control, which only allows the user to enter a valid format.
If i want the format of "MM/DD/YYYY"
Then, how can I write change the above code you have given?
Feb 14 '07 #6
hariharanmca
1,977 1GB
If i want the format of "MM/DD/YYYY"
Then, how can I write change the above code you have given?
Better you give one lable at the top of the text1.Text with caption of the date format which you need then onely it will users friendly.... Ok
Feb 14 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
2
by: Cesar Ronchese | last post by:
Hello All! I have a .Net project that, in my machine, the dates are showed in this format: dd/mm/yyyy. But, when I install the project in some customer machines, the date is showed in this...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
20
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the...
7
by: Paulo | last post by:
Hi, how can I return just the date from a DateTime field ? Any C# .net 2.0 / SQL function? Thanks a lot!
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
11
ollyb303
by: ollyb303 | last post by:
Hello, I am using a dynamic crosstab report to track performance statistics for my company and I have hit a problem. I would like the option to track stats daily (for the last 7 complete...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.