Results 1 to 3 of 3
  1. #1
    BiotinX is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2020
    Posts
    7

    CInt, CDbl Overflow errors

    I have a string x123456. I use the right function to remove the x
    =Right("x123456",6)

    Then I'm trying to convert that to a number, but no matter what I use, CInt, CLng, CDbl, I get an overflow error.



    What am I doing wrong? Is there an easier way to separate the number from the letter?

    Thanks!

  2. #2
    BiotinX is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2020
    Posts
    7
    I'm sorry. The problem was a datatype mismatch.

  3. #3
    Ajax is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,709
    if there are not always 6 numbers, use the mid function

    =mid("x123456",2)

    or replace function

    =replace("x123456","x","")

    and try using the val function

    =val(
    mid("x123456",2))

    google these functions to find out more

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-23-2015, 01:51 PM
  2. Replies: 4
    Last Post: 06-21-2014, 05:43 AM
  3. Overflow
    By Joe8915 in forum Forms
    Replies: 4
    Last Post: 10-28-2012, 05:21 PM
  4. CInt and Invalid Use of Null
    By drewetzel in forum Access
    Replies: 4
    Last Post: 10-21-2011, 03:52 PM
  5. Replies: 10
    Last Post: 07-25-2011, 12:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums