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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to ignore InputMask if nothing is entered?

Status
Not open for further replies.

pctest

Programmer
Apr 12, 2004
89
US
If an inputmask is XX.XXX.XXX but I don't wan't the '.' to be saved if nothing is entered, how to do it?


Thank you for any help.
 
pctest,
try this.

if substr(m.var,1,2)=" "
repl m.var with " "
else
insert into alias() from memvar
endif
 
You're going to get an error with this statement:
repl m.var with " "

But if you have the control bound the field, you may have to bind it to a memory variable instead:
Code:
IF ALLTRIM(ThisForm.Text1.Value) == ".   ."
   m.var = Chrtran('ThisForm.Text1.Value', '.', '')
   REPLACE MyTable.Field WITH m.var
ENDIF
Or you may need to create a trigger to handle the conversion.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top