X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> VBA Instr Causes Not Enough Memory Error Even On Newly Created Files., Access 2016    
post Jun 11 2018, 11:14 PM

Posts: 67
Joined: 18-January 16


This has had me pulling hairs badly. Today afternoon Access crashed all of a sudden and from now on it behaves weird regarding basic VBA string functions. First, it kept crashing on a Left$ line until I changed it to Left on one file. Then, on another .accdb file, it suddenly sent "Not enough memory errors" when using Instr and crashed when trying to compile. Even the automatically generated backup kept the error. Exasperated, I did the nuclear option of importing all objects from a new database file and the error kept occurring. Now to confirm it I created a new blank database and even there the Instr function throws the not enough memory error. Curiously, some older but already existing .accdb files compute the function without a problem.

I have reinstalled Access and uninstalled Rubberduck to no avail. Access somehow kept my VB Editor preferences so I suspect it wasn't a full uninstall. I also suspect the basic VBA library must have been corrupted so String Functions are faulty. Where can I fix that?
Go to the top of the page
post Jun 12 2018, 01:11 AM

Posts: 189
Joined: 2-April 18

Did this happen after some patch install? After uninstalling Rubberduck did you check references in your project? Try to clean registry with ad hoc software. (backup, backup and backup again)
This post has been edited by Phil_cattivocarattere: Jun 12 2018, 01:11 AM

Please forgive in advance my horrible English.
Go to the top of the page
post Jun 12 2018, 06:36 AM

UtterAccess VIP
Posts: 7,448
Joined: 24-May 10
From: Downeast Maine

Perhaps it is a problem with library references. This article should get you started toward investigating the possibility.
Go to the top of the page
post Jun 12 2018, 10:20 AM

Posts: 109
Joined: 4-June 18

Copying all items to a new database won't necessarily solve issues where you have corrupt compile code which I suspect is the case here.
Nor with reinstalling Access.

If that is your issue, decompiling will solve the problem http://www.fmsinc.com/microsoftaccess/Perf...e/Decompile.asp

To use this first make a backup, then decompile...its very fast.
Afterwards recompile then compact.

You may already know the following:
If not already done, tick require variable declaration in the VBE.
This will add the line Option Explicit to all new code modules but not to those that already exist.
So add the line yourself immediately after the line Option Compare Database
Now compile again and correct any errors due to undeclared variables. Compact again
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    24th June 2018 - 11:33 AM