Microsoft KB Archive/177058

= PRB: Wizard Generated Form Not Showing Complete Text Box Value =

Article ID: 177058

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q177058



SYMPTOMS
The number of characters you enter into a text box on a form generated with the FoxPro Wizard is limited even when you expand the field width in the table.



CAUSE
The InputMask property determines the number of characters for the text box. The number of characters in the InputMask picture code, such as 'XXXXXX', limits the number of characters that can be entered into the text box.



RESOLUTION
After you increase the table's field width, you must also edit the InputMask property of the text box on the form.



STATUS
This behavior is by design.



MORE INFORMATION
When the form is created with the wizard using an existing table, the wizard uses the table's field width to determine the number of input characters allowed in the InputMask property.

The "X" permits entry of any character. The number of Xs determines how many characters can be entered into the form's text box.

After you modify the table in the Table Designer and increase the field width of a character field, you expect to be able to enter more characters into an existing field. However, the number of characters cannot exceed the previous field width.

NOTE: This same behavior can occur in any form when the InputMask property is used to control data entry into a text box or other control.

Steps to Reproduce Behavior
NOTE: The following code in step 1 creates a new table that is used in the steps 2-6 and is modified to illustrate the problem.   Copy the following code to a test program and run the code to create Testtext.dbf, which contains five sample records: ***** Table setup for TEST of Text Box InputMask ***** CREATE TABLE 'testtext.dbf' ; (FNAME C(6), LNAME C(10), SEQUENCE I(2))

***** Add five records for testing ***** INSERT INTO testtext (FNAME, LNAME, SEQUENCE) ; VALUES ('George', 'Washington', 1) INSERT INTO testtext (FNAME, LNAME, SEQUENCE) ; VALUES ('John', 'Adams', 2) INSERT INTO testtext (FNAME, LNAME, SEQUENCE) ; VALUES ('Thomas', 'Jefferson', 3) INSERT INTO testtext (FNAME, LNAME, SEQUENCE) ; VALUES ('James', 'Madison', 4) INSERT INTO testtext (FNAME, LNAME, SEQUENCE) ; VALUES ('James', 'Monroe', 5)  Create a new form using the Form Wizard.

 On File menu, click New. Click the Form option button, and then click the Wizard button. Select Form Wizard in the list box and click OK.</li> In the Form Wizard, click the double right arrows between the Available fields list box and the Selected fields list box. This moves all the fields from the Available field list into the Selected fields list box. Click Finish.</li> Click Save, and run the form. Next, click Finish.</li> In the Save As dialog box, use Testtext.scx, and click Save.</li></ol> </li> Add a new record in the newly created wizard-generated form Texttext.

<ol style="list-style-type: lower-alpha;"> Click the Add button and then select the Fname text box.</li> Try to type John Quincy into the Fname field. Notice that when you finish typing the "Q", the cursor automatically moves into the next text box field.</li> Click Revert, and then click Exit.</li></ol> </li> Modify the structure of the table.

<ol style="list-style-type: lower-alpha;"> Type the following commands into the FoxPro Command window:

USE && Closes the current table, which may be opened shared.

USE testtext.dbf EXCLUSIVE && Opens the table exclusively.

MODIFY STRUCTURE

</li> Select the width spinner of the Fname field and increment it to 12. Click OK.</li> When you see the dialog box "Make structure changes permanent?", click Yes.</li></ol> </li> Increase the width of the Fname field on the Texttext form.

<ol style="list-style-type: lower-alpha;"> Open the form and select the Fname field.</li> Right-click to select Properties.</li> In the Properties tab, select Layout, and then select the Width property.</li> Increase the width of the field by typing 110, and press ENTER.</li></ol> </li> <li>Run the form from the main FoxPro Form menu.

<ol style="list-style-type: lower-alpha;"> <li>Repeat step 3.</li> <li>Notice the same behavior occurs.</li></ol> </li></ol>

To implement the solution in the RESOLUTION section: <ol> <li>Increase the InputMask of the Fname field on the TESTTEXT form.

<ol style="list-style-type: lower-alpha;"> <li>Open the form and select the Fname field.</li> <li>Right-click to select Properties.</li> <li>Click the Data properties tab and select the InputMask property.</li> <li>Increase the width of the field by adding six more Xs to the current display of "XXXXXX" and press ENTER.</li></ol> </li> <li>Test the new form field InputMask property by selecting Run Form from the main FoxPro Form menu.

<ol style="list-style-type: lower-alpha;"> <li>Repeat step 3.</li> <li>Now you can enter the entire string, "John Quincy" in the Fname field.</li> <li>Click Revert and then click Exit.</li></ol> </li></ol>

<div class="references_section">