ACC: Number Field with Input Mask Appears as Text in MS ExcelID: Q161331
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you export a table to Microsoft Excel using the OutputTo macro action
or a Visual Basic method, Number fields that have an input mask appear as
Text fields in Microsoft Excel.
When a field in a table uses an input mask, Microsoft Access outputs the data in a custom format. The custom format causes the indexed sequential access method (ISAM) driver for Microsoft Excel to treat the field as Text.
If you want to maintain your data as a Number field, use the Save As/Export command on the File menu. If you only want the data in Microsoft Excel to look the same as it does in Microsoft Access, you can use OutputTo.
Table: InputMasks
------------------------
Field Name: 99999 text
Data Type: Text
Input Mask: 99999
Field Name: 99999 number
Data Type: Number
Input Mask: 99999
Field Name: 00000 text
Data Type: Text
Input Mask: 00000
Field Name: 00000 number
Data Type: Number
Input Mask: 00000
Field Name: ##### text
Data Type: Text
Input Mask: #####
Field Name: ##### number
Data Type: Number
Input Mask: #####
99999 99999 00000 00000 ##### #####
Text Number Text Number Text Number
------------------------------------------------
12345 12345 12345 12345 12345 12345
01201 01201 01201 01201 01201 01201
1 2 3 123 12300 12300 1 2 3 123
Macro Name Action
-----------------------
TestXLFormat OutputTo
TestXLFormat Actions
---------------------------------------------
OutputTo
Object Type: Table
Object Name: InputMasks
Output Format: Microsoft Excel (*.xls)
Output File: c:\My Documents\InputMasks.xls
Auto Start: Yes
For more information about the OutputTo action or method, search the Help Index for "OutputTo action" or "OutputTo method."
Keywords : kbinterop IsmOthr IsmExl5
Version : 7.0 97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 28, 1999