Solved

Date & time validation

Posted on 2002-04-16
6
285 Views
Last Modified: 2008-03-17
hi!
 I am not really good in access at all, however i have a job to use an access database with delphi via ADO.

i was wondering, what exactly do i need in the validation text boks to check that we have typed in a date. and another box for time...

time() is no good... since it prints both time & date...


0
Comment
Question by:joepezt
6 Comments
 
LVL 57
ID: 6944721
It's not clear if your using Delphi just to look at the data, or are using Access for the programming.  If your using Access, you'd use the IsDate() function to return a logical to check for a valid date.

Jim.
0
 

Expert Comment

by:muzori
ID: 6944896
put in text box like this
=date()
0
 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 6945263
If you use Delphi via ADO I suppose, or BDE, in both cases you must DoubleClic the TAdoTable, or Ttable and then right button of the mouse - Add all fields.

Now, if you has the little box with all the fields and the form tha you use to enter the data, select a Date or Time field and in the set the EditMask property for exaple !99/99/0000;1;_ for Date, or !90:00:00;1;_ for time.

Then you select  the fiedl and drag it and drop over the form. thats all.

Best Regards.
Marcos.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 2

Author Comment

by:joepezt
ID: 6947227
marocs: how do i put this in the validation rule in my access database?

date (!99/99/0000;1;_) ?
0
 
LVL 3

Accepted Solution

by:
marcoszorrilla earned 10 total points
ID: 6947396
Well if you wont to put this mask in Access.
you must select the field and set the properties like this form example.
Format:ShortDate ..... You select your desired format
InputMask:99/99/00;0;_ You have a list to choice

For Time is the Same, and the same properties to set.

Of Course first at all you select your table and the design mode.

Best Regards
Marcos.
0
 
LVL 2

Author Comment

by:joepezt
ID: 6947437
hehe, ok, I have been blind ;)
thanx =)
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now