Results 1 to 9 of 9
  1. #1
    markcrobinson is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    New Hampshire, US
    Posts
    31

    SOLVED: Left(quan) something's corrupted?

    I've been running a vb application I wrote for several months now.
    Suddenly, when I run it, I get an error:

    Click image for larger version. 

Name:	Annotation 2020-07-17 171956.jpg 
Views:	19 
Size:	140.2 KB 
ID:	42455

    It's erroring on compile a simple "left" statement.
    I go into the immediate panel typing ? Left("abcd",2) and get the same error. ? RIGHT("abcd",2) works fine
    I notice, as I'm typing the command, the suggestion is wrong.




    Click image for larger version. 

Name:	Annotation 2020-07-17 172831.png 
Views:	19 
Size:	10.1 KB 
ID:	42456

    Troubleshooting:
    I close my application, open a blank database, and it's fine. My access program isn't corrupted

    So there is something in my application (just a bunch of vb scripts, tables, and queries) that is changing the format and meaning of the LEFT command. I've disabled my startup switchboard, done a compact and repair database, checked my form startup code. I'm lost.

    Does this make sense to anybody?
    Last edited by markcrobinson; 07-18-2020 at 05:42 AM.

  2. #2
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Any missing references in the VBE?

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Also,if your db gets close to the limit of 2gig,weird errors like that will happen.
    but ,most likely it's a missing reference.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    This is vb.net or VBA?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    markcrobinson is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    New Hampshire, US
    Posts
    31
    Thanks. Checked, but no missing references.

  6. #6
    markcrobinson is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    New Hampshire, US
    Posts
    31
    Its VBA. I've got a bunch of tables and queries and vba code to manage them.

  7. #7
    markcrobinson is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    New Hampshire, US
    Posts
    31
    Small file 75k

    Another quick data point...
    As soon as I open the database -- before running anything, the error exists (identified by typing Ctrl-G and Left( then seeing Left(quan come up as the suggestion).
    If I then File->close the database and hit Crtl G, when I type Left( or Right( no suggestion appears.

    Can't even see how to troubleshoot this.... May try opening a new database and importing components from the "corrupted?" one.

    Or I may eat a gummy bear and watch Arrested Development again...

  8. #8
    markcrobinson is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    New Hampshire, US
    Posts
    31

    Solved: an ID-10-T error.

    OK, I'm just posting this in the unlikely event that anyone does something so stupid as to cause an error like this, and to prostrate myself in deft apology to those helpful people who truly know how to program.

    Stuck in the middle of my code somewhere was

    ______________
    Function Left(quan)

    End Function
    _______________

    Have no idea how it got there -- perhaps and errant paste or Access trying to autocorrect an unfinished line by making it a function. Interesting, though, how it allowed me to redefine a built-in function like Left(. I wonder if I can use that....

    For any fellow idiots that follow me down this path of corruption and find this thread, to troubleshoot I created a new database, imported components of the original until I imported the errant module. Each time typing Left( to see if the weird hint occurred. In the module that triggered it I Cut one half, then the other, until I narrowed it down.

    If I die from eating too many gummy bears, please tell my grandchildren that I was killed by bears.

  9. #9
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    That is actually another possible reason that comes up when googling your issue, having a sub/function with the same name.

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

Similar Threads

  1. Corrupted Databases
    By plengeb in forum Access
    Replies: 5
    Last Post: 06-10-2016, 04:57 PM
  2. DB corrupted?
    By tcox in forum Access
    Replies: 4
    Last Post: 10-26-2015, 04:21 PM
  3. Databases Keep Getting 'corrupted'.
    By Robeen in forum Access
    Replies: 24
    Last Post: 09-20-2013, 09:32 AM
  4. Help!! - Corrupted Module
    By rcrobman in forum Modules
    Replies: 3
    Last Post: 04-29-2011, 03:37 PM
  5. Replies: 3
    Last Post: 02-02-2011, 01:00 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