Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TDateTime and Edit Masks

Posted on 1998-03-26
4
Medium Priority
?
612 Views
Last Modified: 2010-04-06
I have a field in a Tquery defined as TDateTime (from an Oracle Date column), and all I want to do is allow the user to modify the date portion.  I have a display format of 'm/d/yy', which is fine.  I put a edit mask of '!99/99/00;1;_' which doesn't work the way I want it to.

For example:  When I cursor to that TDBEdit field it changes from 3/20/98 to _3/20/AM and I can't edit it correctly.  Any ideas on what to do?

NOTE:  If the date field has NO time (0) it works fine.
0
Comment
Question by:gjbaker
4 Comments
 

Expert Comment

by:BigMadDrongo
ID: 1360919
The underscore specified at the end of the edit mask is that character shown in empty characters in the masked edit box, and that is why if you omit then first character in the month field, it will replace it with the underscore.  The only way round this that I'm aware of is to enter the date as 03/20/98.  I personally don't like the masked edit boxes because of this limitation.  Hope this info is useful!
0
 

Author Comment

by:gjbaker
ID: 1360920
I don't have a problem with the underscore, but why does AM show up where the year is suppose to?  It's even worse if I want the year to be four digits.
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1360921
I was going to answer the question but I figured this might just be a work around so I'll put it as a comment

in the OnEnter event of the DBEdit do this
DBEdit.Text := FormatDateTime('MM/DD/YYYY', DBEdit.Field.Value)

that should at least do what you need...some person I work with mentioned this too...I don't know if they fixed it or went with something else...
0
 
LVL 1

Accepted Solution

by:
jturpin earned 100 total points
ID: 1360922
The uderscore in the edit mask is the character used
to fill the spaces. Simply edit the edit mask and replace
the underscore with a space.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

971 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