Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ONSETTEXT EVENT - TEXT IS MISSING!

Status
Not open for further replies.

selena1

Programmer
Joined
Apr 7, 2003
Messages
69
I have a trouble with OnSetText event for component DBEdit. I connect DBEdit1 with component Table1, field "Phone". I set EditMask of that field on next value: "!\(999\)000-000;1;_". After thatI, I wrote Table1PhoneSetText event (for example: Label1.Caption := 'Phone is correct.';).
Trouble is, when I start application and wrote some phone number in component DBEdit1 (correct value), after I exit DBedit1, text in DBEdit1 was deleted. If don't have OnSetText event I don't have this trouble. I don't have any idea what is wrong. I use Paradox database.
THANKS!
 
In OnSetText, do you allow for empty strings?

For example:
Code:
Two small caveates with Andrew's code:

procedure TForm1.AFieldSetText(Sender: TField; const Text: String);
begin
   if Text = '' then
       Sender.Clear
   else
       Sender.AsString := ...
end;

Cheers


Cheers
 
One small caveate Richard. I didn't provide any code for this thread!

Andrew
 
Hehehe...methinks another small caveat is the use of <CTRL-C><CTRL-V>!

Andrew, can't you see that invisible post you made, just above Richard's?!

Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top