VBFOXDEV35
Programmer
Hello again all. Now I have this twist to the VFP world.
I have a textbox where I want to make sure only Numeric values are entered into the textbox, if not I want the focus to go back to that textbox (currently using the lostfocus()), select all the current textbox value (this.format = "K"
and then re-type the numeric expression.
Everytime the LostFocus Event fires, The focus goes to the next textbox, here is what I have right now.
GotFocus Event of Textbox
This.Alignment = 0
This.Format = "K"
LostFocus Event of Textbox
LOCAL dblValue
dblValue = This.Value
IF TYPE(dblValue) = "N" then
This.Value = NUMFMT(ALLTRIM(this.Value), 15, 2, ""
This.Alignment = 1
ELSE
MESSAGEBOX("Numeric expression only, please re-enter numeric value.",64, "Notice"
This.SetFocus
ENDIF
Any suggestions would be greatly appreciated. Thanks
Art
Art DeGaetano II
Software Developer, MOUS
I have a textbox where I want to make sure only Numeric values are entered into the textbox, if not I want the focus to go back to that textbox (currently using the lostfocus()), select all the current textbox value (this.format = "K"
Everytime the LostFocus Event fires, The focus goes to the next textbox, here is what I have right now.
GotFocus Event of Textbox
This.Alignment = 0
This.Format = "K"
LostFocus Event of Textbox
LOCAL dblValue
dblValue = This.Value
IF TYPE(dblValue) = "N" then
This.Value = NUMFMT(ALLTRIM(this.Value), 15, 2, ""
This.Alignment = 1
ELSE
MESSAGEBOX("Numeric expression only, please re-enter numeric value.",64, "Notice"
This.SetFocus
ENDIF
Any suggestions would be greatly appreciated. Thanks
Art
Art DeGaetano II
Software Developer, MOUS