Reference & Codes

  • Thread starter Thread starter mgp
  • Start date Start date
M

mgp

When creating an event procedure in A2K, I get
an "illegal procedure call or argument". Even if I leave
it empty.
------------------------------------
Private Sub ButAddCo_Click()

End Sub
------------------------------------
When trying to change the references in tools to reset
them, I get "Can't remove control or reference; in use"

HELP !!!!

What can I do to troubleshoot this problem?
 
You can never remove the Access or VBA libraries, but you may be able to
solve the issue by closing Access and re-registering one of the libraries.

Example:
regsvr32 "c:\program files\common files\microsoft shared\dao\dao360.dll"

More info:
http://allenbrowne.com/ser-38.html
 
Thanks Allen but I wasn't able to resolve it.

I re-registered "Visual Basic for
Applications", "Microsoft Access 9.0 Object
Library", "OLE Automation" and "Microsoft ActiveX Data
Objects 2.1 Library" but I still get the same problem. In
addition, if I try to add the reference (since it's
missing in the references) "Active X", I get an error
when I exit the database: "The Save operation failed".

HELP
 
Okay: so you do have a missing reference.

Did you try unchecking the box? Close your application. Then open the app
and check the library again. If you succeed in reregistering it, this will
force Access to reload it from the correct location.

You may also want to download and install the MDAC update from:
http://www.microsoft.com/downloads/search.aspx?displaylang=en

If you do not have Service Pack 3 for Access 2000, that's worth grabbing
also:
http://office.microsoft.com/ProductUpdates/default.aspx
 
Actually Allen ... I've just done some other testing and
I'm starting to believe it's not related to references.
To answer your question ... no I don't have "missing" in
front of any references but I did re-register as you've
indicated through the "run" command.

I cannot uncheck 2 of the 4 boxes and when I uncheck the
2 I can, they are automatically checked when I load the
application again. I assume it's because of the "The Save
operation failed" message.

I have found out that I can run any of the forms until
an "event procedure" is called. As soon as any of
the "event procedure" is triggered, the error "illegal
procedure call or argument" prevents me from continuing.
For example the switchboard fails on load.

If I run a previous version (December backup), I can run
the switchboard but it fails when trying to exit the form
(it does a "run code" that has a "DoCmd.RunCommand
acCmdExit")

I've also noticed that if I run an earlier backup from
July, I can run switchboard from start to finish without
errors. Yet switchboard has all the same event procedures
and codes.

Any ideas where to look??!!

mgp
 
Create a new (blank) database.
Set up the desired references.
Import all objects from the broken database: File | Get External | Import.
 
I've tried it but the codes doesn't seem to import with
the forms and when I try to enter the code window, it
won't let me. I should add the point that this is a
Microsoft Contact Management database you get under
the "New.." option.

Does this help to offer more ideas?

Please say yes :-}
 
The database is partially corrupt.

Try a decompile:
Backup your file first.
Close Access.
Open a command prompt.
Enter something like this. (It's one line, and include the quotes):
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\My Documents\MyDatabase.mdb"

Then open the database and compact (Tools | Database Utilities | Compact).

If it still crashes when importing, take note of WHICH object it is trying
to import when it crashes. Import the other objects, and rebuild that one
(or those ones).
 
Back
Top