OpenForm action cancelled error using Vista

C

Crossh

I have an 2003 access database that works fine on Windows XP, but errors out
on the docmd.openform line of code (OpenForm action was cancelled) after
upgrading to Vista. Strangely enough, this is only a problem for one form, so
far. All the other forms that have identical code work fine. Basically, I
have the user select a record from a subform and then click on a command
button
(which rebuilds the query for another form, saves it, and then opens the
form to
allow editing of the selected record).

Here's the code:
DoCmd.OpenForm "frmNameOfForm", , , , , , "Edit"

Thanks for your help.
 
S

Stefan Hoffmann

hi,
I have an 2003 access database that works fine on Windows XP, but errors out
on the docmd.openform line of code (OpenForm action was cancelled) after
upgrading to Vista. Strangely enough, this is only a problem for one form, so
far.
Sounds like corruption. Create a new .mdb, import all your objects
(tables, queries, forms etc.)...


mfG
--> stefan <--
 
C

Crossh

Thanks, but I don't think that's the issue. It only happens when the user
with Vista runs the code. The database works fine for everyone else (using
Windows XP). I have already sent the Vista user new copies of the working
database, and it still errors out on that line of code. Maybe I should
mention that it's an Acces front-end with SQL Server 2005 on the backend. Any
other ideas?
 
S

Stefan Hoffmann

hi,
Thanks, but I don't think that's the issue. It only happens when the user
with Vista runs the code. The database works fine for everyone else (using
Windows XP). I have already sent the Vista user new copies of the working
database, and it still errors out on that line of code. Maybe I should
mention that it's an Acces front-end with SQL Server 2005 on the backend. Any
other ideas?
Timeout due to lock escalation? What does your code when this form is
opened?

mfG
--> stefan <--
 
C

Crossh

I have the user select a record from a subform, click on a command button on
the main form. The command button rebuilds the query for the new form that I
want it to open, saves the new query, and then opens the new form (which uses
the query as the record source) to allow editing of the selected record. The
subform is a pass thru query with no locks.

Again, this is ONLY an issue using VISTA. I have had users running these
forms for over a year without ever having any problems. This one user
upgraded to Vista, and now he has this problem. All other Windows XP users
run fine.

I have another form/subform in this database, which is identical in logic,
except that is refences another query. This form works fine for the Vista
user.

Thanks for your help.
 
S

Stefan Hoffmann

hi,
Again, this is ONLY an issue using VISTA. I have had users running these
forms for over a year without ever having any problems. This one user
upgraded to Vista, and now he has this problem. All other Windows XP users
run fine.
Drop any error handler, maybe this will reveal someting. Basic question:
does this user run the same Office, same Service Pack, same Jet/MDAC?
Does he run this database from a local drive? Has he sufficent rights
for this location?


mfG
--> stefan <--
 
C

Crossh

I have the error handler commented out, that's how I know which line is
causing the error. This user has a new laptop, which is why he has Vista. I'm
sure nothing is the same, the rest of us have Windows XP. But how would that
explain two forms in this same database, with the same code, operating
differently? One works fine and the other errors out only on the
docmd.openform line of code. Both forms are using ODBC links to the same SQL
Server db. He can edit the record while in the raw data, just can't open the
one form.
 
D

Dirk Goldgar

Crossh said:
I have the error handler commented out, that's how I know which line is
causing the error. This user has a new laptop, which is why he has Vista.
I'm
sure nothing is the same, the rest of us have Windows XP. But how would
that
explain two forms in this same database, with the same code, operating
differently? One works fine and the other errors out only on the
docmd.openform line of code. Both forms are using ODBC links to the same
SQL
Server db. He can edit the record while in the raw data, just can't open
the
one form.


PMFJI, but I doubt it's the OpenForm action itself. But if there's
something about the form being opened that prevents it from being opened, it
will have the same effect. Can that form be opened by double-clicking it,
directly from the database window? Can the form's recordsource be opened
directly? Is there any code in the form's Open event that might be causing
an error?
 
C

Crossh

What does PMFJI mean? Yes, the form can be opened by double-clicking from the
database window. Yes, the form's recordsource can be opened directly. There's
plenty of code, but wouldn't that be a problem when opening directly, too?
 
D

Dirk Goldgar

Crossh said:
What does PMFJI mean?

"Pardon me for jumping in".
Yes, the form can be opened by double-clicking from the
database window. Yes, the form's recordsource can be opened directly.
There's
plenty of code, but wouldn't that be a problem when opening directly, too?

Yes, normally. Hmm ... I notice that your OpenForm line is passing a value
via the OpenArgs argument. Maybe the code to process that argument is
causing an error. Try executing that exact line from the Immediate window,
and see what happens.
 
C

Crossh

I just found the culprit. Apparently Vista dosn't like to filter the dates in
the db. The query has a date filter in it. If I go into any table and try to
filter any date (just by clicking on the the Filter By Selection button) I
get the message, "Microsoft Access has stopped working" and it closes the db
down. I have installed all the latest updates for Vista and Office. Now what?
 
D

Dirk Goldgar

Crossh said:
I just found the culprit. Apparently Vista dosn't like to filter the dates
in
the db. The query has a date filter in it. If I go into any table and try
to
filter any date (just by clicking on the the Filter By Selection button) I
get the message, "Microsoft Access has stopped working" and it closes the
db
down. I have installed all the latest updates for Vista and Office. Now
what?

It seems unlikely that it's a Vista problem. Did you only upgrade your OS,
or did you upgrade to Access 2007 at the same time? Did you actually
upgrade your OS and/or copy of MS Office, or are you switching your database
between different PCs with different versions installed?
 
C

Crossh

I could, but it's not not the query, it has something to do with trying to
filter the date. When I go into any ODBC linked (SQL 2005) table and try to
filter any date (just by clicking on the the Filter By Selection button) I
get the error message, "Microsoft Access has stopped working" and it closes
the db down. Apparently Vista doesn't like SQL Server dates?
 
C

Crossh

FYI, I decompiled then compiled all Access 2003 databases and now everything
works fine on the Vista machines.
 
D

Dirk Goldgar

Crossh said:
FYI, I decompiled then compiled all Access 2003 databases and now
everything
works fine on the Vista machines.


Thanks for posting your resolution.
 
M

Marshall Barton

Crossh said:
FYI, I decompiled then compiled all Access 2003 databases and now everything
works fine on the Vista machines.


In my experience, the most prevalent kind of corruption that
Decompile fixes is caused by editing code when it is in
break mode. I have not had this kind of corruption since I
have made a habit of always ending/resetting whatever I was
testing and switching to design view before changing *any*
code.
 

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

Top