Access database stops responding after form opens

  • Thread starter Thread starter Brian Scheele
  • Start date Start date
B

Brian Scheele

This happens in just about any database with Access XP.
When I run code that does various tasks, such as
importing data, running queries, etc. and the final task
is to open a form, the form opens but when you try to do
anything in Access, you get a beep noise. Cannot go to
any field. Cannot close the database by clicking
the "X". Cannot click File, Edit, View, etc. Cannot
right-click on the app in the task bar to close. The
only way to close is to make sure the database has the
focus in Windows then either Alt-F4 or CTRL-ALT-DEL and
end task.

The only time that this problem happens is if while the
code is executing, some other program gets the focus in
Windows, such as switching over to Excel while it
executes. Also happens if an email comes into Outlook
and you have the notification turned on so that it pops
up next to the clock.

This happens on all computers and for all users.

When you are trying to navigate through Access while the
problem is occurring, it is acting as if there is a
hidden form open somewhere that is Modal and waiting for
you to close it (however there are no such forms).

All service packs have been applied to OS and to Office.
Compact / Repair does no good. This also happens on new
databases. Database version (97, 2000, XP) does not
matter. Old versions of the Access program (not the
database version) did not have this problem.

Anyone have any ideas?

Please respond here as well as to my email address
([email protected])
 
By chance is there a message box behind the Access window (if you can move
the window enough to see)? Are you using DoCmd.Echo and turning off the
screen updates? What is the command line you are opening the form with? What
happens if you press Ctrl+Break?
 
Do you have any hard code loops without a doevents?

while <condition not met>
' needs DoEvents here!!
wend

HTH,
TC
 
Usually the database opens with a startup form that does
something similar to the following:

Private Sub Form_Open(Cancel As Integer)
DoCmd.Close

DoCmd.Maximize

On Error Resume Next

DoCmd.DeleteObject acTable, "PORVR"

DoCmd.DeleteObject acTable, "PORVX"

On Error GoTo 0

DoCmd.TransferDatabase acImport, "dBase
IV", "I:\Database\Extracts\Daily",
acTable, "porvr.dbf", "PORVR"

DoCmd.TransferDatabase acImport, "dBase
IV", "I:\Database\Extracts\Daily",
acTable, "porvx.dbf", "PORVX"

DoCmd.OpenForm "Main Form"
End Sub


I do not use any loops.
 
Private Sub Form_Open(Cancel As Integer)
DoCmd.Close

DoCmd.Maximize

Do you really try to close the form as soon as you open it? Try commenting
out these two DoCmd lines and see what happens.
 
Anywhere you click in Access, including the title bar,
status bar, the form, any buttons - anything in Access,
you get a beep. Can't move an windows. Cannot move the
access database. When right-clicking on the app in the
task bar, there is no context menu (such as restore,
close, etc.)
CTRL-Break does nothing. When the form is open, there is
no more code to run.

Typically, my Access databases open with a startup form
that acts as a sort of splash screen while I am importing
data from other databases. When that is done, I close
the splash screen, then open the main form. At that
point, the user is supposed to be able to use the
database.

There are no message boxes.

I have never used the docmd.echo command.

command line to open the form is:
docmd.openform "Main Form"

As long as the Access app has the focus in Windows the
entire time that it runs its code, everything is fine,
but if it tries to open a form while another program has
the focus, the Access app stops responding to the
keyboard and mouse (except CTRL-F4 and Alt-F4 and a
couple of other function keys).

When pressing Ctrl-F4, it does successfully close the
form and returns me to the database window, but that also
is just as unresponsive.

F1 will still open a help window.
F7 will still spell check
Shift-F1 will still put a ? on the mouse (but can't click
anything)
Shift-F2 will still open a zoom window
 
It does not matter if I place the docmd.close command at
the beginning or end of the code.

Since the last thing that the startup form does is open
the main app form, I will try putting the docmd.close in
the second form that opens so that form 2 closes form 1
instead of form 1 closing form 1.

Instead of using a startup form to run code to prepare a
database for use, is there another way to run code when a
database opens?
 
There is another way to run code when a database opens. You could have an
autoexec macro and use the RunCode option. However, since you are just
running code then opening another form, could you move the code from the
first form to the second form and just run it there. This would make the
second form the startup form. If you open and close that second form, you
could set a global variable as a flag to indicate that the startup routine
had already been run once.
 
Hi Brian Scheele,

I wanted to post a quick note as you said you will have a try on community
members suggestions :)

If you would like additional assistance or information regarding this
particular issue. We appreciate your patience and look forward to hearing
from you!

Sincerely yours,

Michael Cheng
Microsoft Online Support
***********************************************************
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks.
 
Back
Top