Board index » delphi » TDateTime and DBedit for time only - help!

TDateTime and DBedit for time only - help!

I am using Interbase and editing a DateTime Field with TwwDBedit. I only
want the users to enter time, which I force with an edit mask. But the
TwwDBedit always reports that the "date" is not valid since only the
time is entered. How can the users enter just time?

Is there a solution for this?

Thanks

Jim Berry
U.S. Dept. Agriculture

 

Re:TDateTime and DBedit for time only - help!


On Tue, 23 Jun 1998 11:56:13 -0700, Jim Berry

Quote
<James.S.Be...@aphisnotes.usda.gov> wrote:
>I am using Interbase and editing a DateTime Field with TwwDBedit. I only
>want the users to enter time, which I force with an edit mask. But the
>TwwDBedit always reports that the "date" is not valid since only the
>time is entered. How can the users enter just time?

Just from memory: TwwDBEdit is derived from DBEdit, so you probably can play
with the events, OnGetText, OnSetText and OnValidate. Typically, as there has to
be a date from the database's perspective, you'd set the date to today and
append the entered time, all in the required format.
If you don't need to compute times, use a varchar instead, and the EditMask to
force it in the format you want.

Happy programming.

Jasper

Other Threads