Microsoft KB Archive/192863

= PRB: Data Entered in Text Box with Mask Differs from Exit Method =

Article ID: 192863

Article Last Modified on 12/11/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q192863



SYMPTOMS
When using an edit mask in a text box on a form, the value of the field is determined by how the control is exited.



RESOLUTION
One way to work around this problem is to set the SelectOnEntry property of the textbox to True (.T.) as follows: ********************Begin Sample - 'Works'************* oX=CREATEOBJECT('myform') oX.SHOW DEFINE CLASS myform AS FORM WINDOWTYPE=1 ADD OBJECT txt1 AS TEXTBOX WITH VALUE=0,INPUTMASK="99,999,999.99" ADD OBJECT txt2 AS TEXTBOX WITH ; TOP=30,VALUE=0,INPUTMASK="99,999,999.99" PROCEDURE INIT THIS.txt1.SELECTONENTRY=.T.        THIS.txt2.SELECTONENTRY=.T.      ENDPROC ENDDEFINE ********************End Sample - 'Works'**************



STATUS
This behavior is by design.



Steps to Reproduce Behavior
  Place the following code in a new program file: **************Begin Sample - 'Breaks'********************** oX=CREATEOBJECT('myform') oX.SHOW

DEFINE CLASS myform AS FORM WINDOWTYPE=1 ADD OBJECT txt1 AS TEXTBOX WITH VALUE=0,INPUTMASK="99,999,999.99" ADD OBJECT txt2 AS TEXTBOX WITH ; TOP=30,VALUE=0,INPUTMASK="99,999,999.99" ENDDEFINE **************End Sample - 'Breaks'************************  Run the program. Press 1 and then TAB. The first field becomes 10.00. Press 1 and then RETURN. The 2nd field becomes 1.00. Press 1 and then TAB. The first field becomes 110.00. Tab back to the first field.</li> Press 1 and then RETURN. The first field becomes 1.00.</li></ol>

Additional query words: kbDSupport kbDSE kbVFp600 kbCtrl kbContainer

Keywords: kbprb KB192863

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.