ms-access 2003: form does not open! help! - ms-access

i have an access db with forms, one of the forms is not opening. i double clicked on it, i tried to open in design mode. nothing happens. there's no error message, but nothing happens.
has anyone had this issue before?
i am sorry i actually am getting an error now:
The error said that there wasn't enough memory to open it or something to that effect.

Here's the bible for Access corruption issues.
http://www.granite.ab.ca/access/corruptmdbs.htm
First things first: try to decompile and recompile (check the help files on how to do that). Next, try creating a second database and importing your form from the corrupt one. Lastly, use SaveAsText and LoadFromText to export and reimport the form.

The lack of an error message makes this extra challenging. OTOH, without an error message, how do you know the form hasn't opened? Could it be open but hidden?
Try these two commands in the Immediate Window:
DoCmd.OpenForm "YourForm", acNormal,,,,acWindowNormal
? Forms("YourForm").Name
Do you you get any error messages then? If so, tell us what error messages and at which step they occur.

Related

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.

Method or Data Member Not found for every control or event

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".

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

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 Prevent the "Please tell Microsoft about this problem" Dialog Boxes

We have an error that we can't seem to find and don't have the need/resources to try and track it down. What we do need to do is just keep the freaking "Please tell Microsoft about this problem" dialog boxes from cluttering up the server.
It is from an MS-Access error (we think) but I can't find where Access is installed (I don't think it is); there is no MS Office directory on any of the drives.
If we could just stop the dialog boxes from appearing that would be great.
Thanks.
Spec: Window Server 2003 sp2
From http://www.codeproject.com/KB/exception/UnhandledExceptionClass.aspx:
If you also want to disable the Windows “Send Error Report” dialog on your computer, right-click on the “My Computer” icon, select “Properties”, switch to the “Advanced” tab, and click on the “Error Reporting” button. In the Options dialog, select the “Disable error reporting” radio button:
Compare also http://www.codeproject.com/KB/exception/ExceptionHandling.aspx for general .NET Exception Handling sanity.
I don't think you realize jusy how serious this error might be. These errors pop up under severe conditions like buffer overflows, null pointer dereferences, division by zero errors, etc. Given that you mentioned that this runs on a server, you potentially (depending on your situation) have a network facing, easily exploitable program!
As others have suggested, you can turn off error-reporting system wide, or you can use the SetErrorMode API to disable it for just your application, but again I would strongly advise to investigate and fix the problem at its root!
Well, I would try and figure out what application is using Access. Not knowing what is running is a real issue, especially when it is having unhandled exceptions!
As far as just disabling?
Try:
Right click 'My Computer'
left click 'Properties'
left click 'Advanced' tab
left click 'Error Reporting' (near bottom)
left click 'Disable error reporting'
It's called the Windows Error Reporting Dialog. You can disable it by following these instructions:
http://www.windowsnetworking.com/articles_tutorials/Disable-Error-Reporting-Windows-XP-Server-2003.html
However, I would be concerned with why you are getting those error messages. You are just concealing a problem which could be very bad.
Since I see three different people posted instructions on how to disable the dialog on their own machine, I'll post this again as an answer instead of just a comment:
They don't want to do that on their customer's machines, because that will disable any application from using the dialog. They just want to prevent it from coming up for their application.
It's not concealing anything, if a program crashes windows will still tell you. The difference is that it won't compile a core dump and try to send it to microsoft for you. It's very useful to disable this garbage.
When working in .net, you can catch all unhandled exceptions (which is what causes this message). But I'm not aware of a way to do the same in Access.
http://devcity.net/Articles/60/1/unhandled_exceptions.aspx