Microsoft Knowledge Base Email Alertz

(815277) - When you query a table that is linked to a Microsoft Excel spreadsheet, you may receive the following error message: Numeric field overflow.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 815277 - Last Review: September 17, 2011 - Revision: 5.0

"Numeric Field Overflow" error message occurs when you query a table that is linked to Excel spreadsheet

Moderate: Requires basic macro, coding, and interoperability skills.
For a Microsoft Access 2000 version of this article, see 815277  (http://kbalertz.com/Feedback.aspx?kbNumber=815277/ ) .

SYMPTOMS

When you query a table that is linked to a Microsoft Excel spreadsheet, you may receive the following error message:

Numeric field overflow.

CAUSE

Access assigns a data type for each field of the Excel spreadsheet. This assignment is based on the data that is contained in the first eight rows. For example, if a field has a Number data type that is in the first eight rows and then has text values in some of the remaining rows, Access assigns the Number data type to the link table field. This causes Access to fail to link the records that have text data values. When you query this field, Microsoft Jet Database Engine encounters text where a number is expected. The query fails with the error message in the "Symptoms" section.

WORKAROUND

To work around this problem, you must make sure that the data values in each field of the source Excel spreadsheet are exactly the same data type. Or, if the fields of the Excel spreadsheet contains data values of a mixed data type, then format the field as Text. Use the following code to reenter the values in the cells. Then, link the Excel spreadsheet to Access. To do this, follow these steps:

Note Before you start these steps, you must backup your Excel spreadsheet.
  1. Open the source spreadsheet in Excel.
  2. In the spreadsheet, identify the fields that have data values of mixed data types.
  3. Select the identified columns and then format the cells in the spreadsheet as Text.
  4. Create a macro in Excel that contains the following procedure:
    Sub Addspace()

    Dim cell As Object

    For Each cell In Selection
    cell.Value = " " & cell.Value
    cell.Value = Right(cell.Value, Len(cell.Value) - 1)
    Next

    End Sub
  5. Select the fields in the spreadsheet that contain data values of mixed data types. Run the macro that you created in step 4.

    Note If an error occurs when you run the macro on the problem cells, ignore the error.
  6. Save the spreadsheet.
  7. Open your database in Access.
  8. From your database, link to the source spreadsheet in Excel.

MORE INFORMATION

When you import, do not link an Excel spreadsheet. This is because the Text data type has a priority in the import algorithm. For example, if the predominant data type that is based on a sampling of data is numeric, but there is at least one text value in that sample, Access imports the whole field as Text.

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
282263  (http://kbalertz.com/Feedback.aspx?kbNumber=282263/ ) ACC2002: Ignored MaxScanRows Setting May Cause Improper Data Types in Linked Tables
208414  (http://kbalertz.com/Feedback.aspx?kbNumber=208414/EN-US/ ) ACC2000: #Num Appears in Linked Microsoft Excel Spreadsheet
For more information about how to create a macro in Microsoft Excel, click Microsoft Excel Help on the Help menu, type Create a macro in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For more information about how to run a macro in Microsoft Excel, click Microsoft Excel Help on the Help menu, type Run a macro in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

APPLIES TO
  • Microsoft Office Access 2003
  • Microsoft Access 2002 Standard Edition
  • Microsoft Access 2000 Standard Edition
Keywords: 
kberrmsg kbprb KB815277
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Brett Anderson Report As Irrelevant  
Written: 9/10/2004 2:36 AM
To rectafy the above issue 'Numeric Field Overflow' I just saved the xl file as a csv and then linked it to an Access table. Then extracted the required data in a MakeTable query and used that to work on. BTW Thanks for the article.