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

How To Make An Inputmask Requiring A999999 (all 7 positions) 1

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
Hello,

A case number here is either a "C" or an "S" followed by six digits. I want to force my user enter all six digits following the letter. I was wondering, is there any way to make an inputmask for A999999 (a character followed by 6 digits) in a text box that would require all 7 places be entered?.

Am I stuck with checking the first position to see if its a "C" or "S" and then checking the Len() to see if its 7 characters long?

Thanks.

Dave R.

The 2nd mouse gets the cheese.
 
1. You can use A999999 as the FORMAT and leave the InputMask blank. May be this can help. However 999999 can be left blank. SO you need to check it with valid command.
Also, the first character value needs to checked. SO you cannot avoid VALID command.
2. But why cant you use the VALID or LOSTFOCUS event to check for the value
IF LEN(ALLT(This.Value)) = 7
IF LEFT(This.VALUE,1) $ "CS"
IF TYPE(RIGHT(this.value,6)) = "N"
RETURN .T.
ENDIF
ENDIF
ENDIF
RETURN .F.


You can also think of coding....
THIS.VALUE = LEFT(THIS.VALUE,1)+
RIGHT("000000"+ALLT(RIGHT(THIS.VALUE,LEN(THIS.VALUE)-1)),6)
and then have the above code as well.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
You're going to have to put code in to check the contents to be sure the user entered all 7 digits. If your InputMask is "Z999999", then they can only enter numbers for the last 6 digits, but you must still check the Length to be sure it was filled.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top