Access 2003 constantly crashing

G

Gillian

Hi

I posted this question in the modules section and after some very helpful
dialogue i've been advised to re-post here.

I have been designing access databases for years but this problem has me
stumped.

I have a very small access 2003 database will only one form and a few
tables. On the form there is a button with the following code.

Option Compare Database
Option Explicit

Private Sub btnCreate_CloseRGs_Click()

DoCmd.SetWarnings False
DoCmd.Echo False

If IsNull(Me.txtCloseRGs_Location) Then

MsgBox ("You must fill in the folder to put the CloseRGs file in!!")

Me.txtCloseRGs_Location.SetFocus

Else

DoCmd.OpenQuery "qryClose_RGs_Temp_Delete"
DoCmd.OpenQuery "qryClose_RGs_Export_Delete"
DoCmd.OpenQuery "qryClose_RGs_Temp_Append"
DoCmd.OpenQuery "qryClose_RGs_Update_1"
DoCmd.OpenQuery "qryClose_RGs_Update_2"
DoCmd.OpenQuery "qryClose_RGs_Update_3"
DoCmd.OpenQuery "qryClose_RGs_Export_Append"

DoCmd.TransferText acExportDelim, "CloseRGs_Export_Spec",
"Close_RGs_Export", _
"G:\DONOR CARE TEAM\Committed Givers\Reactivate Monthly Data\" &
Me.txtCloseRGs_Location & "\CloseRGs.csv"

MsgBox "The CloseRGs file has been generated"

End If

End Sub


I have used this type of code in a hundred different place with no problems
but in this application no matter whether you trigger the if or the else
after finishing working through the code Access crashes completely.

I don't get an error it just dies and i have to ctrl-alt-del out.

I have tried a rebuild, compact/repair, decompile, re-created the sub from
scratch, uninstalled access and reinstalled, uninstalled the whole office
suite and reinstalled. It still crashes!!

This is really bugging as it's the simplest database i've created in about
10 years and i can't get it to work.

I'm sure it's not the code as i've followed it through using breakpoint and
it works perfectly gets to the end sub perfectly and then the application has
hung behind it.

Any help would be greatly appreciated.

Thanks
 
D

Dirk Goldgar

Gillian said:
Hi

I posted this question in the modules section and after some very helpful
dialogue i've been advised to re-post here.

I have been designing access databases for years but this problem has me
stumped.

I have a very small access 2003 database will only one form and a few
tables. On the form there is a button with the following code.

Option Compare Database
Option Explicit

Private Sub btnCreate_CloseRGs_Click()

DoCmd.SetWarnings False
DoCmd.Echo False

If IsNull(Me.txtCloseRGs_Location) Then

MsgBox ("You must fill in the folder to put the CloseRGs file
in!!")

Me.txtCloseRGs_Location.SetFocus

Else

DoCmd.OpenQuery "qryClose_RGs_Temp_Delete"
DoCmd.OpenQuery "qryClose_RGs_Export_Delete"
DoCmd.OpenQuery "qryClose_RGs_Temp_Append"
DoCmd.OpenQuery "qryClose_RGs_Update_1"
DoCmd.OpenQuery "qryClose_RGs_Update_2"
DoCmd.OpenQuery "qryClose_RGs_Update_3"
DoCmd.OpenQuery "qryClose_RGs_Export_Append"

DoCmd.TransferText acExportDelim, "CloseRGs_Export_Spec",
"Close_RGs_Export", _
"G:\DONOR CARE TEAM\Committed Givers\Reactivate Monthly Data\"
&
Me.txtCloseRGs_Location & "\CloseRGs.csv"

MsgBox "The CloseRGs file has been generated"

End If

End Sub


I have used this type of code in a hundred different place with no
problems
but in this application no matter whether you trigger the if or the else
after finishing working through the code Access crashes completely.

I don't get an error it just dies and i have to ctrl-alt-del out.

I have tried a rebuild, compact/repair, decompile, re-created the sub from
scratch, uninstalled access and reinstalled, uninstalled the whole office
suite and reinstalled. It still crashes!!

This is really bugging as it's the simplest database i've created in about
10 years and i can't get it to work.

I'm sure it's not the code as i've followed it through using breakpoint
and
it works perfectly gets to the end sub perfectly and then the application
has
hung behind it.

Any help would be greatly appreciated.


Hmm. It seems to me that this line:
DoCmd.Echo False

would prevent any of your message boxes from being seen and responded to by
the user. Why is that line there? If you're going to turn off all
screen-updating, you need to do it in a limited scope where you have ensured
that there will be no need for any user-interaction.
 
D

Dirk Goldgar

Dirk Goldgar said:
Hmm. It seems to me that this line:


would prevent any of your message boxes from being seen and responded to
by the user. Why is that line there? If you're going to turn off all
screen-updating, you need to do it in a limited scope where you have
ensured that there will be no need for any user-interaction.


I've done a little more testing, and it seems that I was wrong about Echo
False suppressing your message boxes. Still, I'd recommend commenting out
that line and seeing what happens. Maybe there's some other user
interaction required. At the very least, if you're going to set Echo to
False, make sure that you set Echo to True again before you exit the
procedure. It may be that that is all that's wrong.
 
G

Gillian

Hi

Thanks for your help, i had totally forgetten to switch the warnings back on
and that was causing the crash. It now works perfectly.

Also docmd.echo and docmd.setwarnings don't have any effect on hard coded
message boxes they are only to suppress errors or information about update
queries or delete queries etc.

Thanks again
Gillian
 

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