Solved

Date & time validation

Posted on 2002-04-16
6
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

726 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