Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access keeps crashing

Status
Not open for further replies.

kabirpatel

Programmer
Nov 16, 2006
12
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top