Access 2003 just ends

  • Thread starter Thread starter Wayne Veale
  • Start date Start date
W

Wayne Veale

I have a Access 2003 db that has been working for about 2 years. Now, on
adding a new record I have a macro that uses an event procedure (on click)
that adds a new record when seleccted (GoTo Record NEW). It has worked great
in the past on many db"s, but now Access encounters a problem and ends. I
have tried to re-compile vb, compact and repair but nothing seems to work.
Any ideas would be helpful. Thanks WWV
 
Since this is only happening on my pc, and I don't know how to change
rights, I don't think they have changes. Could you tell me how they would
cjange? Thanks
 
Hi Wayne,

It sounds like your database has suffered some corruption. Try the following:

Create a brand new database and immediately disable the NameAutocorrupt
feature (see: http://allenbrowne.com/bug-03.html for reasons why you want to
do this). Then import all objects from the suspect database into the new
database, one group at a time. In other words, import all tables (but not
linked tables), then import all queries, then all forms, etc. While Access
will allow you to import all objects in one operation, the experts at FMS,
Inc. (a Microsoft Partner), have stated that it is best to import objects one
group at a time (Reference:
http://www.fmsinc.com/ubb/Forum12/HTML/000285.html).

Recreate any linked tables from scratch. Access can cache a lot of
information about linked tables, which may no longer be valid, so it's always
best to recreate the linked tables from scratch. When importing local tables,
make sure to check the option to import relationships, menus and toolbars,
and import/export specs. If any of the local tables in the source DB are
hidden, you'll need to first unhide them. You will need to set the checked
references to match the source database, along with any startup options set
under Tools > Startup. Going through this process often times solves
corruption problems, because you get a new set of the hidden system tables
(the tables whose names start with "MSYS"). These system tables are updated
appropriately as you import objects.

This may sound like a lot of work, but it really isn't. Creating a new
container DB, disabling NameAutocorrect, importing all objects one group at a
time, re-establishing any linked tables, setting startup options, and setting
references to match the source DB is usually a fairly quick procedure. When
you are in the Visual Basic Editor, in order to check that the references
match the source DB, you should do a Debug > Compile ProjectName as well.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Access MDB is completely obsolete.

move away from it; and don't listen to these BUFFOONS
they're just in this for self-preservation.

If you're too fat and lazy to learn SQL Server then you shouldn't be
writing databases.

-Aaron
 
I tried the recreate and no luck. The msg I'm getting is
The expression On Open you entered as the event property setting produced
the following error. Object or close does not support the set of events.
The expression may not result in the name of a macro, the user defined
function, or [event procedure]
There may have been an error evaluating the function, event, or macro.

Again, this has always worked for me in the past.
Thanks for help.
WWV
 
Hi Wayne,

It sounds like you have made some progress, since you indicated in your
initial message that Access just terminated. Now, you seem to be getting an
error message, but you're not getting the more serious general protection
fault (GPF). Is this correct?

Try opening any code module, or create a new one if necessary. Then click on
Tools > References. Are any of the references marked as MISSING? If so,
please refer to these two articles for corrective action:

Solving Problems with Library References (Allen Browne)
http://allenbrowne.com/ser-38.html

Access Reference Problems (Doug Steele)
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

After closing the references dialog, but with the Visual Basic Editor (VBE)
still open, try clicking on Debug > Compile ProjectName, where ProjectName is
the name of your VBA project (likely the same name as your database). Does
your code compile okay? If not, you need to fix any compile-time errors.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
I'm not getting a GPF. When I'm in VB it seems to compile ok. The only thing
I can think is different is, I now have "Total Access Analyzer" from FMS.
Not sure if this helps.
WWV
Tom Wickerath said:
Hi Wayne,

It sounds like you have made some progress, since you indicated in your
initial message that Access just terminated. Now, you seem to be getting
an
error message, but you're not getting the more serious general protection
fault (GPF). Is this correct?

Try opening any code module, or create a new one if necessary. Then click
on
Tools > References. Are any of the references marked as MISSING? If so,
please refer to these two articles for corrective action:

Solving Problems with Library References (Allen Browne)
http://allenbrowne.com/ser-38.html

Access Reference Problems (Doug Steele)
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

After closing the references dialog, but with the Visual Basic Editor
(VBE)
still open, try clicking on Debug > Compile ProjectName, where ProjectName
is
the name of your VBA project (likely the same name as your database). Does
your code compile okay? If not, you need to fix any compile-time errors.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

Wayne Veale said:
I tried the recreate and no luck. The msg I'm getting is
The expression On Open you entered as the event property setting produced
the following error. Object or close does not support the set of events.
The expression may not result in the name of a macro, the user defined
function, or [event procedure]
There may have been an error evaluating the function, event, or macro.

Again, this has always worked for me in the past.
Thanks for help.
WWV
 
Hi Wayne,

Total Access Analyzer is an excellent product. I have recommended this
software on many occasions. I have it installed on my PC as well (version
10.7.0032). I've never had any problems with opening/using Access
applications, with this software installed.

If the code compiles okay, then the next thing to start looking for is a
run-time error. If you have any form events that are expressions, for
example, Form Open: =FunctionName(), make sure that the event(s) or
referenced macros are valid. Total Access Analyzer may be helpful in
revealing any calls to invalid functions or macros. Can you add a break point
to code in the affected form? Check to see if you are using an open, load,
activate, etc. event procedures. If so, try adding a break point into the
associated procedure(s).


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
I'm not getting a GPF. When I'm in VB it seems to compile ok.

You've mentioned compiling, but have you *DECOMPILED* before
recompiling? If not, you could be maintaining old, corrupt compiled
code.
 
This is the event procedure I'm using at OnOpen of my add form
Private Sub Form_Open(Cancel As Integer)
DoCmd.RunMacro "GOTO NEW"
End Sub
GOTO NEW macro is goto record new
Not sure if this helps. Also, being Newbe, how do I decompile in VB?
Thanks for sticking with me on this.
WWV
 
Hi Wayne,

Your initial message indicated a click event procedure; the code you show
below runs your macro in the Form_Open event procedure. You can replace your
macro with one line of VBA code:

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
End Sub

or, using named arguments, instead of positional arguments:

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord Record:=acNewRec
End Sub

If you simply want to open the form to a new record, but you don't need to
see existing records, then you can set the Data Entry property to Yes.
Alternatively, you can use VBA code to open a form to either all records, or
to a new record. For example:

DoCmd.OpenForm "frmMembers", DataMode:=acFormAdd
versus
DoCmd.OpenForm "frmMembers"

To decompile your code, you can use the following *if* you only have one
version of Access installed on your PC: Click on Start > Run, and enter the
following command:

msaccess /decompile

The next database you open will have it's code decompiled. If you have
multiple versions of Access, then I recommend creating a shortcut for each
version that includes the undocumented /decompile switch. To read more about
this option, check out Michael Kaplan's page:

http://www.trigeminal.com/usenet/usenet004.asp?1033


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

Wayne Veale said:
This is the event procedure I'm using at OnOpen of my add form
 
Your right, I had two cases where it did not work (2 forms) In either case I
changed to the VBA code and as if by magic, all is well and working again.
Thank you so much for the help and putting up with a newby.
WWV
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top