Microsoft KB Archive/252637
Article ID: 252637
Article Last Modified on 2/3/2000
- Microsoft Visual FoxPro 6.0 Professional Edition
This article was previously published under Q252637
When using the Microsoft Visual FoxPro Form Wizard to create forms containing currency fields, text boxes that have currency fields as their controlsource are displayed with a US dollar ($) currency symbol. A currency symbol of $ is displayed regardless of the regional currency settings.
Text boxes with the Format property set to $ that are added to a form created using the Form Wizard also display a currency symbol of $, regardless of regional currency settings.
There are two workarounds for this issue:
- Alter the Format and InputMask properties of text boxes that display currency data:
- Set the Format property of the text box to a null string.
- Include the currency symbol to be used in the InputMask property of the text box. For example, to set the currency symbol to Pesetas with the currency symbol displayed to the left of the amount, set the InputMask property to: "Pts9,999,999,999,999,999.99."
- Create forms that contain currency data without using the Form Wizard.
Steps to Reproduce Behavior
Use the following code to create and populate a table with three records:
CREATE TABLE CURRTBL (char_fld c(10), curr_fld1 y, curr_fld2 y) FOR I = 1 TO 3 INSERT INTO CURRTBL VALUES (REPLICATE(CHR(I + 64), 10), I ,I) ENDFOR
- On the Main menu, click the Tools pad, and then select Wizards and Forms.
- From the Wizard Selection dialog box, select the Form Wizard option.
- In step 1, select CURRTBL, and select all of the available fields.
- Click the Finish button, select the Save and run form option, and then click the Finish button again. Save the form when prompted.
- With the new form running, on the Main menu, click the Tools pad, and then select Options.
- Select the Regional Settings tab and set the Currency Symbol to Pts (Pesetas). Click the OK button.
- Note that the currency symbol in the two currency fields of the wizard form is $.
- Close the form by clicking the Exit button.
- Type CREATE FORM DEMO in the Command window and press the ENTER key.
- When the Form Designer opens, right-click on the form and select Data Environment from the shortcut menu.
- Add CURRTBL.DBF to the DataEnvironment.
- Drag Curr_fld1 from the DataEnvironment and drop it on the form.
- Set the Format property of the text box txtCurr_fld1 to $. Save and run the form.
- Note that the currency symbol is Pts (Pesetas).
- Repeat steps 6 and 7 to reset the Currency Symbol to $.
- Note that the currency symbol on the non-wizard created form is now $.
Additional query words: MONEY
Keywords: kbprb kbwizard kbpending KB252637