Access keeps crashing... (1 Viewer)

KabirPatel

Registered User.
Local time
Today, 16:31
Joined
Nov 16, 2006
Messages
38
Hi,

I have an MS Access 2000 .adp that makes use of SQL Server 2000 backend. Historically the application has worked fine.

Recently I added a new continuous form that is bound to a stored procedure. The form has a combo box at the top that enables users to specify which fields in the form should be visible.

Upon selecting an option, the user will see a custom view of the underlying data source.

e.g. A user might select "Tracker 1" from the combo box, which refers to viewing fields 1, 4, and 10 in the data source.

For this to work, I have added numerous text boxes to the detail section of the form. Only the relevant text boxes become visible.

The underlying data source is composed of a join between 2 tables. This causes problems with in line editing as the Unique table property cannot be properly set.

To get around this I do the following:

a) I set the unique table property of each control in the GotFocus event of the control. i.e. Me.UniqueTable = "myTable"

b) I save each record in the LostFocus event using
DoCmd.RunCommand acCmdSaveRecord

In order for this to work I have created a class as follows:

Option Compare Database

Private WithEvents m_TextBox As TextBox
Private strUniqueTable As String

Public Property Set cmdTextBox(ctl As TextBox)
Set m_TextBox = ctl
m_TextBox.OnEnter = "[Event Procedure]"
m_TextBox.OnLostFocus = "[Event Procedure]"
End Property

Private Sub Class_Terminate()
Set m_TextBox = Nothing
End Sub

Private Sub m_TextBox_Enter()

Forms![frmTracker].UniqueTable = m_TextBox.StatusBarText

End Sub

Private Sub m_TextBox_LostFocus()

DoCmd.RunCommand acCmdSaveRecord

End Sub

All of the above works fine. I deployed the application to a number of people to test. For most people the application works without problem. However, a few people keep finding that the application crashes with the message "Access has generated errors".

The version of Access is the same, the SP's are the same, the code base is the same. I am at a loss as to what the problem could be :(

I have considered the possibility of a memory leak, but have got to a point where I am sure that all the objects are set to nothing.

Do you have any suggestions?

Thanks,
Kabir
 

KabirPatel

Registered User.
Local time
Today, 16:31
Joined
Nov 16, 2006
Messages
38
Further info....

After doing some further research, I have determined that a DrWatsn error is generated each time MS Access crashes. The dump file states that:
"Exception code: C0000005 ACCESS_VIOLATION".

This seems to indicate that MS Access is trying to access memory that it does not have rights to.

The problem I have is that MS Access doesn't crash in response to the same action. Sometimes it crashes when you exit the application. Other times it crashes when you close a form etc.... Other time it doesn't crach at all.

Do you have any ideas about how I could troubleshoot this problem?

Thanks,
Kabir
 

Users who are viewing this thread

Top Bottom