Moving a numeric field to integer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CLSkcab
    New Member
    • Aug 2014
    • 26

    Moving a numeric field to integer

    Background: Front end MS Access 2010; back end MS SQL Server 2008; limited knowledge in SQL

    I have a field named QTY in a SQL table defined as numeric (18,0) and has a value of 60000. The program is reading this field in a
    variable defined as integer - Dim gblQTY as Integer. I am getting a run time error '6' - Overflow. What is wrong? Thanks in advanced.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    In VBA, the integer data type can only hold a value between -32768 and 32767. Use a larger data type like Long.

    Comment

    • CLSkcab
      New Member
      • Aug 2014
      • 26

      #3
      That did the trick. Thank you.

      Comment

      Working...