Access crashing and ?fix?

D

Damon Heron

Hi gurus. I have recently had a problem with Access crashing whenever I
selected a report from a list on a form - I mean serious crashing where you
get the message to send info to MS, doesn't give you a code segment or
anything....
Anyway, the code in the click event of a cmdbutton was:
Me.visible = false
DoCmd.OpenReport stDocName, acPreview, , strWhere

The idea was to make the form invisible while the report was shown and to
make it visible with a function that fired when the report preview was
closed.

What seems to have fixed it is the following -I moved the visible code after
the openreport and
using the full reference to the form:
DoCmd.OpenReport stDocName, acPreview, , strWhere
Forms!frmAllReports.Form.Visible = False

Any ideas why my original code was a problem? Or have I really not fixed
it?

Damon
 
T

Tom van Stiphout

On Fri, 8 May 2009 12:02:34 -0700, "Damon Heron"

Move the line back where it was and report back to you. I think there
is a 99% chance the report will not crash.

-Tom.
Microsoft Access MVP
 
D

Damon Heron

You were almost right - how about a 100% chance? I did as you suggested,
and
the form and report work as expected. I am still confused why it was
crashing EVERY time before I moved the line - which fixed it....then moving
it back to the original code also fixed it. Was it some corruption in the
db, or?

Damon
 
T

Tom van Stiphout

On Sat, 9 May 2009 10:00:23 -0700, "Damon Heron"

I'm guessing corruption of the compiled VBA, and shaking the tree
fixed it.
You'll be keeping very good backups, right?

-Tom.
Microsoft Access MVP
 
D

Damon Heron

ALWAYS!!!!

Damon

Tom van Stiphout said:
On Sat, 9 May 2009 10:00:23 -0700, "Damon Heron"

I'm guessing corruption of the compiled VBA, and shaking the tree
fixed it.
You'll be keeping very good backups, right?

-Tom.
Microsoft Access MVP
 
T

Tony Toews [MVP]

Damon Heron said:
The idea was to make the form invisible while the report was shown and to
make it visible with a function that fired when the report preview was
closed.

Why do you feel you need to do this? Whenever I open a report in
preview it's always the foreground. So there's never been a need to
hide the criteria form.

Tony
 
D

Damon Heron

I use this thruout my app for multiple forms and reports
because the screen looks cleaner and less cluttered.

Damon
 

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