File: How to Change a Number Field to a Text Field

ID: q20323


The information in this article applies to:
  • Microsoft File, versions 1.0, 1.01, 1.02, 1.04, 1.05, 2.0


SUMMARY

This article explains how to change a number field to a text field.


MORE INFORMATION

When fields for ZIP Codes, phone numbers, part numbers, and other data containing numbers are created, a common mistake is to create these fields as Number fields. This causes problems such as leading zeros not displaying in ZIP Codes and nonnumeric characters (such as dashes in phone numbers) producing error messages. For this reason, you should format as Text fields any fields that contain numbers that are not used in calculations. Sorting numeric entries in Text fields yields the same results as sorting them in Number fields.

Unfortunately, the problems resulting from Number-formatted fields may not be detected until after the data is entered in the database. When this happens, you can correct these problems by using the procedure below to change the type of the field once data has been entered.

CAUTION: Do NOT use this procedure if your file contains picture fields. The graphics stored in the picture fields will be lost.

To Change the Field Type of a Field in File

  1. If the form is not open, choose Show Form from the Form menu.


  2. If commas are showing in the field, double-click the field in the form and turn off the Commas option. Close the form.


  3. From the File menu, choose Save Records As. Choose Yes if File prompts you to save the current form with the data file. Select the Text option in the dialog box, give the data file a new name with a .TXT extension, and choose the Save button.


  4. From the File menu, choose New Datafile. Name the data file and choose New. Create a new data file with the same number of fields as the original document. The field names do not have to match the field names in the original document; however, make sure the field names are in the same order. When entering the field types, be sure to change the type of the desired field. For example, be sure to create Text fields for fields that will contain ZIP Codes.


  5. Close the form of the new document.


  6. From the File menu, choose Open Datafile and select the name of the text file you saved earlier (the one with the .TXT extension).


  7. Under normal circumstances, an error message will appear. To correct this problem, delete the first record of the new data file.


  8. Add leading zeros in the new fields if needed.


Additional query words: 1.00 1.01 1.02 1.04 1.05 2.00


Keywords          : 
Version           : :1.0,1.01,1.02,1.04,1.05,2.0
Platform          : 
Issue type        : 


Last Reviewed: October 22, 1999
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.