Access 2016: The method you tried to invoke on an object failed - ms-access

This is on an upgraded Access solution from 2015 to 2016. Also, new solution is using a MySQL backend database on Amazon Web Server. So I'm not sure which change may be causing the issue.
When I execute the code
DoCmd.RunCommand acCmdSaveRecord
Or, when I just move to another record, causing an intrinsic save, I get the error 2759 with the following description:
The method you tried to invoke on an object failed
Also in some conditions when I apply a filter to the form I get this error also.
Does anybody have a suggestion on how to fix this, and/or what is causing it?

Related

There was an error while loading the package SSIS

I have created one SSIS package for data flow and its perfectly working fine for me (with my credentials). However, when its opened by another person with another login ID (credentials) its showing error:
Please see the below screenshot.Looks like its an access error. How can I give access so that anyone can open it.
The error I'm getting is :
the operation failed because the databse manager failed to access either the databse manager configuration file or the database configuration file.
There ware errors while loading the package. See the error list for details.
Error loading Package.dtsx. Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified satte. You may not be
authorized to access this information. This occurs when there is a cryptographic error. Verify that the correct key is available.
Upon searching on net. I think I can set "DontSaveSensitive". However,unable to find out how to do this? Whats are the steps I need to follow?
Link : https://learn.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages
How to resolve this?
Kudos for pinpointing issue. To solve it:
Open project solution from working credentials.
Right click on project.
Go to properties
Change the security level to DontSaveSensitive.
I've answered your question about unable to find out how to do this
Hope this works. Else come back here and we might suggest different approach.

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 2010 Runtime Error 2185

Hi I have an application created in Access 2007, it's front-end and back-end is split. I am trying to open the database using Access 2010 runtime, however the application crashes when I change selected item of a combo box.
I receive the following error:
"Execution of this application has stopped due to a run-time error. The application can't continue and will be shut down."
After researching the problem, a few people mentioned running the compact and repair, and found that fixed their problem, however it made no difference to mine.
However, I found most people to come back and say put some error logging in place. So I have done that, and when running on 2010 runtime, a receive a pop up message saying the following:
Error number: 2185, You can't reference a property or method for a control unless the control has the focus.
However when running in Access 2007, there is no error and the code works fine.
This is the code I have been using:
Private Sub ComboBox1_Change()
If Not ComboBox1.Text = "" Then
ComboBox1.Dropdown
End If
End Sub
My question is, why would this suddenly become an issue running on 2010 runtime, when there is no error in Access 2007?
change If Not ComboBox1.Text = "" Then to If Not ComboBox1 = "" Then
For whatever reason Access does not like you use the .Text property outside of it's strict control.

MS-Access compile options

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.

How to fix method saveastext of object failed?

This is Access 2003. From an access database code module, I am opening two outside access databases and then saving the text of two forms that exist in both of the databases. I am executing the statements:
Call app1.SaveAsText(acForm, "MyForm", "c:\MyForm_app1.txt")
Call app2.SaveAsText(acForm, "MyForm", "c:\MyForm_app2.txt")
Both app1 and app2 are of type Access.Application.
I receive the error:
Method 'SaveAsText' of object ' Application' failed
This error only happens on this specific app2 form. Other forms in app2 are saving just fine. I am using Access 2003. There was a trial of Access 2007 installed but now that is removed. I am still getting the same error.
Thanks for your help. I am really puzzled over this one.
Gotta love undocumented options. For kicks and giggles, I'd try renaming one of the two forms. Or, swap the two statements and see if app1 starts erroring. It looks like the forms has identical names, perhaps Access is leaving the first one open and getting confused.
Maybe something is slightly corrupt in app2. You could always try running the /decompile option on app2 (take a backup first of course)
That form is possibly corrupt. See if you can open that form in Access and then save it under a different name. Or import the entire database into a new file.
The problem was that there is a bug in Access 2003 where it cannot handle databases converted from Access 2007 to Access 2003. The fix is to install the latest Service Pack for Office 2003.