PRB: Wizard Generated Form Not Showing Complete Text Box Value
ID: Q177058
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a, 6.0
-
Microsoft Visual FoxPro for Macintosh, version 3.0b
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.
- 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.
- Click Save, and run the form. Next, click Finish.
- In the Save As dialog box, use Testtext.scx, and click Save.
- Add a new record in the newly created wizard-generated form Texttext.
- Click the Add button and then select the Fname text box.
- 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.
- Click Revert, and then click Exit.
- Modify the structure of the table.
- 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
- Select the width spinner of the Fname field and increment it to 12.
Click OK.
- When you see the dialog box "Make structure changes permanent?",
click Yes.
- Increase the width of the Fname field on the Texttext form.
- Open the form and select the Fname field.
- Right-click to select Properties.
- In the Properties tab, select Layout, and then select the Width
property.
- Increase the width of the field by typing 110, and press ENTER.
- Run the form from the main FoxPro Form menu.
- Repeat step 3.
- Notice the same behavior occurs.
To implement the solution in the RESOLUTION section:
- Increase the InputMask of the Fname field on the TESTTEXT form.
- Open the form and select the Fname field.
- Right-click to select Properties.
- Click the Data properties tab and select the InputMask property.
- Increase the width of the field by adding six more Xs to the current
display of "XXXXXX" and press ENTER.
- Test the new form field InputMask property by selecting Run Form from
the main FoxPro Form menu.
- Repeat step 3.
- Now you can enter the entire string, "John Quincy" in the Fname
field.
- Click Revert and then click Exit.
REFERENCES
For more information about the InputMask property, please see the following
article in the Microsoft Knowledge Base:
Q143285 How to Use Format and InputMask to Format Data
Microsoft FoxPro Help; search on: "InputMask Property"
© Microsoft Corporation 1998, All Rights Reserved. Contributions by Perry Newton, Microsoft Corporation
Additional query words:
textbox inputmask
Keywords : kbMAC kbVFp kbVFp300 kbVFp300b kbVFp500 kbVFp500a kbVFp600 FxtoolDbtabledes FxtoolWizscreen
Version : MACINTOSH:3.0b; WINDOWS:3.0,3.0b,5.0,5.0a,6.0
Platform : MACINTOSH WINDOWS
Issue type : kbprb
|