Board index » delphi » a couple of questions

a couple of questions

A newbie seeks some help:

When i exit a DBEdit field (i.e. a date field) after having entered an
illegal date i get something like: '32312' is not a valid date.

How do i change that error message to something else i want (i.e. a
different language) ?

Is it possible to use Edit Masks on DBEdit fields ?. I've tried using
Picture from Database Desktop, but that only works when i enter data
from the Database Desktop and not from DBEdit fields within the
program.

Can i use MaskEdit together with DBEdit fields, and thereby control
the input ?

-
Jorgen Christensen

 

Re:a couple of questions


Jorgen,
Here are two alternatives:

1) Write a BeforePost eventhandler.
2) Write an OnPostError eventHandler.

I prefere the first one, because you have everything in your own hands.
Check if the text in the DBEdit is a valid date. If yes, do nothing;
if no : open a dialog and abort the posting.
In this method you can check every field you want.

Hope this helps and success,
Alfred.

Jorgen Christensen <al...@post1.tele.dk> schreef in berichtnieuws
380dd31e.27989...@news.inet.tele.dk...

Quote
> A newbie seeks some help:

> When i exit a DBEdit field (i.e. a date field) after having entered an
> illegal date i get something like: '32312' is not a valid date.

> How do i change that error message to something else i want (i.e. a
> different language) ?

> Is it possible to use Edit Masks on DBEdit fields ?. I've tried using
> Picture from Database Desktop, but that only works when i enter data
> from the Database Desktop and not from DBEdit fields within the
> program.

> Can i use MaskEdit together with DBEdit fields, and thereby control
> the input ?

> -
> Jorgen Christensen

Other Threads