Method or Data Member Not found for every control or event - ms-access

Got a weird problem. I was debugging some code for a form and everything was working as intended for the most part when suddenly I began to get a "Method or Data Member Not Found" for every event of my form. It's like my form suddenly does not recognize any of my controls or events. I have all of my methods properly closed and did not rename any controls.
Any ideas on what would be the root of "Method or Data Member Not Found" for every single control with an event?
Thanks

Importing into a fresh database as talbright suggested gave me more descriptive error messages.
A fresh import, compact&repair, and renaming of appropriate control fixed the problem from occuring. As Remou suggested, regular maintenance can help prevent these sorts of problems.
edit for future readers: This problem occurred while using a shared front end file. So don't do that if possible.

I've found that any MISSING: reference can make the simplest of code fail.
Check in the visual basic window
Menu Tools -> References
look down the checked refences to see if any are MISSING

I just fixed the same error by renaming text and combo boxes something not so close to a concatenated Table & Field string. Actually just prepended those names with "tbx" and "cbx".

Related

VBA Access form doesn't show

I'm developing an application in MS Access, using VBA.
The application already exists but I have to add a button and a piece of code in a form.
The problem is that, when I add the button and try to show the form, I don't receive an error but the form isn't visible.
I'm sure that the form is open, because, if I try to delete it, I receive an error that tells me that is not possible to delete an opened form.
Can anyone tells me the solution?
Edit: I still have the same problem on another form in my application. The form worked since i add a piece of code in it. Now, also deleting the code it doesn't work... I've also tried to decompile the application but nothing changed...
The following function has several arguments for show/hide etc. With the correct parameters you should be able to get that form to be visible:
OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)
All the argument options can be found here.

Refresh form from subform event handler

I seem to be having a problem that looks an awful lot like it could be a bug in MS Access. I have a form which enumerates all the rows in a table and lets you edit them in a subform. Upon clicking save in the subform (standard save button converted to VBA), I want to update the list of records in the main form. I seem to have done just that with this code:
Parent!List0.Requery
Parent!List0.Refresh
Parent!List0.SetFocus
However, the list of records only seems to update with the changes upon clicking somewhere in the box, giving it focus.
Has anyone run across this, or does anyone have any suggestions as to how to solve this?
I cannot reproduce the issue, at least not in Access 2010. I had to comment out the Parent!List0.Refresh statement because that was causing a run-time error ("Object doesn't support this property or method"), but once I did that the List Box was correctly updated as soon as I clicked the button on the subform. There must be something else at play here. Could you possibly have error handling in place that is "swallowing" the run-time error I received?
Set a breakpoint at the beginning of the Button_Click() code and follow it through. Perhaps your code is not executing the way you think it is.
Get rid of the Refresh statement, it's not necessary. You'll probably get a run-time error right there because that property isn't supported.

MS Access Treeview error loading ActiveX control [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
MS-access doesn't catch treeview events after win sec-update
recently an error appeared with a Treeview element in my access form.
The expression Expand you entered as the event property setting produced the following error: There was an error laoding an ActiveX control on one of your forms or reports.
When I click "OK" (only opportunity) the next error appears (Expand is replaced by MouseMove, MouseDown/Up, DblClick etc.), when I press Keys the KeyDown/Up/Press Message appears etc.
When I interact with the TreeView then the "Expand" is replaced by e.g. NodeClick or Collapse.
Every message only appears once, when I performed every possible Event no message pops up - but the treeview doesnt work, it doesnt open any form (the treeview is used as a menu).
The mysterious thing to me is - last week those Access Databases all worked fine - we have a database for every customer (frontend and data together) and now suddenly every database 'crashes'. I assumed that the ActiveX Treeview Control was changed by a Windows Update or something similar but also an old WinXP laptop throws the same error messages.
Even a database that hasnt been opened for 2 weeks and definitely worked back then doesnt work anymore. So from my point of view there cant be anything in the code that is wrong.
Nevertheless I tried to set a breakpoint in the Form_Load event, but the Expand Error already pops up before the first line of OnLoad is executed.
The OnLoad Event is the only event that is specified (GUI says "Event Procedure", its VBA Code only) and all other fields are blank (and no code specified).
I created a blank VBA for e.g. MouseMove, but the error still appears.
What is this error and where does it come from? Hope anyone can help.
Regards,
Matthias
P.S.:
My Treeview Project
Via this Link you find the files for a treeview project in MS Access (mentioned in the first answer). When I download these files the same kinds of error appear.. so it definitly has to do with the activeX controls, right? Is there anybody where these files work, and if so - why? Hope anybody can help..
I was having the same problem - treeview worked last week not today in either 2007 or 2010 Access, multiple PCs. Problem was Windows update. (See link http://support.microsoft.com/kb/2687441). I created and ran the batch file as indicated in the kb article and my Treeview now works.
I got the same error. I found the solution in the following link:
http://mymsaccessblog.blogspot.nl/2008/09/my-teeview-project-episode-5-using.html
I added the following sub listed below and adjusted it with the key I used and it worked.
I hope this helps you as well. Sorry if the formatting is not good. First time I post anything
Private Sub xProductTreeview_Click()
Dim nodSelected As MSComctlLib.Node ' a variable for the currently selected node
Set nodSelected = Me.xProductTreeview.SelectedItem ' get the currently selected node
If nodSelected.Key Like "Prod=*" Then ' are we on a product node
ElseIf nodSelected.Key Like "Cat=*" Then ' are we on a category node
Else ' somehow this is neither a category or product node
End If
End Sub

Communicating with the OLE Server or ActiveX Control

MS Access 2010, Win 7 on a regular formI didn't intentionally place any ActiveX or OLE things.. not even sure what they are. But anyways, whenever I put something in the code of a particular form, it says "The Expression XXXXX you entered as the event property setting produced the following error: A problem occured while MyDB was communicating with the OLE server or Active X Control
Huh? No matter what I put in the form's code, this happens. I had an empty Form_Current() ONLY which still tripped this. There's a lot of formatting and work into the form, I'd rather not scrap it.. If I leave the code window completely empty (only Option Compare Database), it does not trip the error; however then my form is useless.
I've seen things about this being a language issue, but my other forms (running the same code techniques and most of the same code) are fine and it's an english Access with an english language PC. Ideas?
Code setting off the error:
Private Sub Form_Current()
End Sub
Seriously.
I faced the same problem and I tried many things, the only (and fastest) solution that worked is to do the following:
1) Close the form that is causing the error.
2) Rename this form.
3) Duplicate it: Copy, then Paste, you will be prompted to set a name for the new form. Give it the original name.
4) Delete the original form that was causing the error.
5) Open the pasted form and it will work OK.
This solution worked fine with my database...
Regards...
Check for missing references. Make a back-up, decompile, compact & repair and if that does not work, copy everything to a new db ( http://www.granite.ab.ca/access/corruptmdbs.htm ) You may have to skip copying the problem form. Sometimes it is worth creating a new form, selecting all the controls from the old form and pasting into the new form.
you can change the language setting to have a try, the steps are as follow:
1、Open window command ,run "intl.cpl"
2、choose the Administrative item ,change the system locale settings.
Hope that can help you.
I have run into this problem many times. The error statement is horrible as it provides basically no useful information. I have found that Abu Hassan's solution typically works best (duplicate the form and delete the original) but that did not work for me on one occasion, where I had to delete an import statement that I had recently added:
imports system.collections
Once I deleted that import statement everything worked again. So if duplicating the form doesn't work then try undoing something you recently did. It could be this import statement or one similar to it.
Very strange error, that sometimes occurs in my databases too.
It seems to go wrong mostly on UNBOUND FORMS (unbound forms have no RECORDSOURCE).
What I have done recently is :
temporarily define "some" table (e.g. a config table with just one record) as the RecordSource,
compile the program (Note that this usually goes OK, even before the fix!)
Save the form.
Open the form. This should work fine now!
Delete the RecordSource, recompile and save again.
Most of the time, my forms work fine again after that.
as my experience some of errors because you use your local language in VBA statement
so you must adjust your local language as language of system from control banal >> language or region>>administrative>>change system local then select your local languages
or find the word was not English in vba and retype it by English

access 2007 bug - intermittent query parameter prompts

I am working on an Access 2007 application that was created by someone else. It has a strange, intermittent bug in which it prompts the user for query parameters when the main form is opened. The query parameters are clearly not necessary, because the error does not always occur.
The very strange "fix" to this problem is to open and close a particular module before opening the main form. Then the form opens without parameter prompts. However, of course I can't ask end users to open and close modules.
I tried using a macro to open and close the module when the database is opened. That fixes the bug, but leaves the VBA code window open, so that's no good.
Has anyone run into anything like this before? Any suggested solutions, workarounds, debugging tips, etc?
If you use the "Database Documenter" feature and check "yes" to all the options, you will obtain an exhaustive report that should let you trap your problem parameter. Export this report as an .rtf or .pdf document, so it is searchable. Identify a keyword from the dialog prompt, and search on that.
Once you check the query objects using the Documenter, check your VBA code. You'll do this by stepping through code in the IDE. If the main form has subforms, they are opened with (within) the main form. And they load before the main form.
Identify those subforms.
Sprinkle
breakpoints in their code modules
(if you find a Load function, that
is highly relevant).
If the main form has a
code module, do the same there.
Have a look for global variables in the module that needs to be opened and closed or any variable that is referenced in the module belonging to the form.
Access displays the Enter Parameter Value dialog box when you open an object that contains an identifier or expression that Access cannot interpret. You need to determine the source object. Here's a step-by-step guide:
http://office.microsoft.com/en-us/access-help/why-does-access-want-me-to-enter-a-parameter-value-HA010274377.aspx