MS-Access compile options - ms-access

Is there a compiler option in ms-access (2003) that requires all vba code to compile before allowing any code to run? I'd like to be able to turn it off. I've tried the unchecking the 'Require Variable Declaration' and 'Auto Syntax Check' options, but no result.
Background information
I've just been given an ms-access database that runs fine on their machine but will not run on my machine. I get this error message on startup:
"The expression On Open you entered as the event property setting produced the following error: Method or data member not found"
This is caused by vba compilation errors in what looks like redundant code. Interestingly the code doesn't compile on either machine, but on their machine it database is usable on my machine it isn't! I assume its something simple like a compiler option, except I can't find it!
(Before anyone mentions it I know that the real solution to the problem is to fix/remove the bad code)

Code will run in MS Access without all code compiling, however, On Open is a form property that runs code when the form is opened, so the code in that event will be compiled and run when the form opens. I have encountered this error before when a version of Access is run on a PC that has two versions installed (specifically, <2007 and >=2007). For me, the solution was to choose Repair from the Help menu.

Access has a /decompile command line switch. See the accepted answer to this StackOverflow question.

Related

VBA Plugin Err: "Requested type library or wizard is not a VBA project"

I have created an .ade from an adp without problems.
When I try to open the .ade file I get the following error:
"Requested type library or wizard is not a VBA project"
The following files are my project:
Lib.ade (Version 1): external library
MainProgram.ade: compiled and made ade when the reference is to Version 1 and it works fine.
I sent these two file to client station without any problems but when I did some new changes and make new Lib.ade (Version 2) and sent to client environment, MainProgram (Version 1) gave the mentioned error.
Thanks for any help.
I got the same error message and it turned out to be a "Phantom Breakpoint" issue. See my posting here for more information:
https://stackoverflow.com/a/56565372/5795793
After several debug sessions in the original file (an ACCDB file in my case), it started breaking to a code line where I had previously, mistakenly left a breakpoint. Even though no breakpoint appeared, I had to duplicate the sub and comment out the original sub for it to work.
Sounds like there might be a phantom breakpoint in Version 2 of the Lib.ade. If so, copying the code elsewhere and commenting out the old code can work. Decompililng may also fix it.
Perhaps my experiences with the same problem will help someone.
Error "Requested type library or wizard is not a VBA project" occurred only in ACCDE, when trying to switch between tabs in level 2 navigation form. Explored all the options with references to library files, decompiling and recompiling, creating new DB and suppressing error message.
The only thing that worked for me is:
in ACCDB Remove all VBA code from the navigation form. Event Property Sheet sheet should be cleared of any events.
In the Other Property Sheet set "Has Module" to NO. (this should anyway delete the all code in the Navigation Form mentioned in step 1, so perhaps step 1 is not required, but better safe than sorry)
Save, Compact&Repair, Compile, Save as ACCDE
Enjoy.

How to increase VBA error output to diagnose consistent crashing after "File not found" error

Is there a way I can make the application MS Access and VBA more verbose in order to better diagnose errors from the IDE?
I open my MS Access project, I get a message dialog box, titled "Microsoft Visual Basic for Applications" with the message "File not found:" without any path specified. Opening the form file works as expected.
When I go into VBA, I can run some commands from the Immediate window. The following actions will make MS Access crash, showing a messaged box titled "Microsoft Access has stopped working":
Closing the database
Stopping the debugger (it opens being active, trying to load a form)
Selecting text of the procedure I was working on when MS-Access / VBA initially crashed.
This does not answer the question, but it seems the underlying problem has been fixed by deleting the procedure in question, letting MS Access crash and re-opening VBA.
To answer the question in your title: If the error is actually cause by VBA code, you can catch the error (using On Error Goto ...) and provide additional information based on the context of your method (the file you were trying to open, etc.). Unfortunately, there is no magical switch to make the built-in error messages more useful.
To answer the question in your question body: From what you describe, the error is not caused by actual user-supplied VBA code. Instead, your database or its VBA module is corrupt (Access crashing or showing seemingly random errors is a strong sign of that). Repair, compact and decompile your database. It might be worth checking out the VBA references as well, so see if any of those are missing.
can you execute the command resume in the immediate window ? it should send you back to the code line where the file was not found.

Access 2013 Undefined function 'Format' in expression

I have created an access database which is used to create reports by various people. The database simply links to various external data sources. Via macros, it runs queries, creates reports and pushes them to a SharePoint site. The macro is triggered by a button. It runs fine for me. No errors and works perfectly. For another user in my department it doesn't work. She gets the following error:
Undefined function 'Format' in expression
I looked and the macro fails on an update query that runs. See the below screenshot.
It doesn't like the "Format" portion of the expression, but only on her PC. It works fine on mine. I don't use 'Format" for any other object in my database so I'm not sure why it would error out. I use the Format function all the time to format date values.
Any idea why this is selectively erroring out on one PC?
Problem: There is Reference List in VBA. Once you open (VBA environment-> Tools-> Reference), you will find a Checked mark in front of “MISSING”.
Solution: Uncheck that check Box which says “MISSING”, and save it.
Result: It will work
Same problem but in Access 2016, I didn't have any references reported as 'Missing' but I found adding in the following reference made it work:
C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB

What contract am I not specifying?

When I try to run my Windows Store app, it won't, and shows me this:
..."does not support the contract specified"? What contract? I'm not implementing any contract; I assume it means the Settings contract or some such, but I'm not doing any of those yet.
I went to the Help page suggested, and it says, in part, "To diagnose these errors
There are no sure ways to fix these errors. Use these techniques to diagnose the problem."
The first suggestion is:
Open Event Viewer (on the Windows Start menu, search for Event Viewer.) In Event Viewer, navigate in the tree to the Application and Services Log\Microsoft\Windows\Apps folder.
Filter the view to event Ids: 5900-6000
Examine the log and see what occurred.
Windows 8.1 only brings up web pages when I search for "Event Viewer"
Actually, I did write a utility to catch event logs, and I ran that. I found these:
***Type: Error
Source: Microsoft-Windows-Immersive-Shell
Time Generated: 11/27/2014 15:10:39
Message: Activation of app App.adaf78a74.a8c80.a4ff5.a99ca.a97636d548196_8wekyb3d8bbwe!Designer.App failed with error: -2144927148 See the Microsoft-Windows-TWinUI/Operational log for additional information.
Type: Error
Source: Microsoft-Windows-Immersive-Shell
Time Generated: 11/27/2014 15:20:08
Message: Activation of app axXAndSpace.Visits_qtyjefqf75sa6!App failed with error: -2144927148 See the Microsoft-Windows-TWinUI/Operational log for additional information.***
But where is "Microsoft-Windows-TWinUI/Operational log"?
The second suggestion on the Help page was:
Use the native debugger
Configure the project to run under a native debugger.
In Visual Studio, set the Debugger Type to Native Only on the Debug (Debugging in C++ and JavaScript) page of the property pages of the start-up project.
Look at the exceptions being thrown by looking at the output window. You might want to configure the debugger to stop when these exceptions are thrown.
I did that, but it gave me no more information than previously - nothing at all displays in the Output pane.
What could be the cause of this?
UPDATE
Just to update the progress:
Based on Iris Classon's suggestions, I went to Control Panel to see if my app was installed so that I could uninstall it, but it's not in that list.
If I search for the app by typing its name, it tries to start up - its splash screen displays, but goes no further than that.
I went to Program Files\WindowsApps, and when selecting it got, "You don't currently have persimmons to access this folder, click continue to continually get access"
That leads me to "You have been denied permission to access this folder; to gain access to this folder, you will need to use the security tab"
Click the "security tab" link takes me to that tab, and a "For special permissions or advanced settings, click Advanced"
I do so.
That takes me to a Permissions tab, which says, "You must have Read permissions to view the properties of this object; Click continue to attempt the operation with administrative permissions"
I then selected (one at a time, as that is all it allows):
Trusted Installer : Full control
System: Read, Write, and Execute
System: Full Control
Administrators: Read & Execute
But so far, none of that seems to do anything good.
UPDATE 2
This problem has just "gone away" today; I don't think it was anything I did. I added a UserControl, tried running the app again, and now it runs - I don't see that error message. However, I do see a seemingly unrelated one. (at least I got further).
I just had this problem on a fresh install of Windows 8.1 on my laptop. I'm not sure which one of these steps solved it, but until somebody can give you a more exact answer here is something to try as I am sure you are keen on coding.
Only Store Apps run from VS gives that error, other Store apps work fine.
I first of all changed permissions on my WindowsApps folder under Program Files and made sure that I had full access to the folder and sub folders. Restarted the laptop, still no luck.
Then I set up an admin guest account (just something I tend to do for when I need to record tutorials- so not related to trying to solve the error). Out of curiosity I tried to create and run the same Windows Store App and got an error that another user had installed the app. Strange, how was it installed if it gave me the error that it couldn't activate the app on the main account?
I logged back in as the main user and uninstalled the application (which was showing up as installed), and I can now run any Store App from VS without problems.
Not sure this is an answer since I'm not sure what made it work, but give it a try and hopefully somebody else can clear this us up. I'll investigate further, but I'm on a train right now with poor WiFi connection :)
Best of luck!
I had the same scenario, here are the steps I did to resolve:
I tried to create packages, chose not to associate with the store.
It said that the certificate is expired, I created a new test certificate.
I created the test packages successfully.
Tried to run the project from VS and it finally ran.
I believe all of this had to do with the certificate. very frustrating and time wasting issue.
I also had the same problem and following steps fixed it. Hope it will help some one else.
Open the appxmanifest file
Go to "Packaging" tab
Select "Choose Certificate" and select "Pick from certificate store" and select your cetificate and click on ok

MySQL Workbench: How can I see the detailed SQL query and errors when I use the "Apply" button? (confirmation popup)

I recently upgraded from MySQL Workbench 5.2.47 up to 6.1.
After making changes to a table via the Gui grid interface on the old version, I'd hit the 'Apply' button and have a popup confirming to make the change. This popup had the SQL code that would run in order to make the change that I made via the UI interface. I would then confirm the action and get a success or failure popup. If a an error occurred, I could see the detailed error in order to easily troubleshoot the problem.
With the new version, I make a change in the GUI interface and hit the 'Apply' button. No confirmation popup, it just executes. The result is a small snippet in output window. This is fine unless there's an error, in which case it has a very generic message. "1 error(s) saving changes to table XYZ". I have not found how to access the detailed error message, either by right clicking the row or looking in the preferences.
So, how do I get the popup confirmation with SQL query and error messaging to work in the new version or, at the very least, be able to see detailed SQL query error details?
Functionality restored in CE release: 6.1.7
http://dev.mysql.com/downloads/file.php?id=452662
It is indeed a bug :-(
In the MySQL bug database:
http://bugs.mysql.com/bug.php?id=72169
http://bugs.mysql.com/bug.php?id=72155
Until they don't fix the bug you can try to close the Query Tab. When it asks if you want Save the Changes or Not, you choose Save and then it shows the detailed errors :)