I can consistently crash Access 2002 SP2 using a /runtime switch on an
mdb that has the Compact on Close property set after opening and
closing a form that uses the References collection. Remove any one of
the three variables in this equation and there is no problem. If
anyone cares to attempt to duplication the problem, just create a
single form with a text box (txtReferences) and a command button
(cmdOK) with the following code behind the form:
Private Sub cmdOK_Click()
DoCmd.Close
End Sub
Private Sub Form_Open(Cancel As Integer)
Dim ref As Reference
Dim sMsg As String
sMsg = ""
For Each ref In Application.References
If ref.IsBroken Then
sMsg = sMsg & "Missing Reference: " & ref.FullPath & vbCrLf
Else
sMsg = sMsg & "Reference: '" & ref.Name & "' " & _
ref.FullPath & vbCrLf
End If
Next ref
txtReferences = sMsg
Set ref = Nothing
End Sub
Set the Compact on Close property and make the form the startup form.
Open the database with the /runtime switch then close the form and use
File | Exit and you will get the message "Microsoft Access has
encountered a problem and needs to close. We are sorry for the
inconvenience." The only references in the database are VBA and
Access 10 and neither is missing. Can anyone duplicate the problem?
Any ideas for a solution?
Rick Collard
www.msc-lims.com