By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

/runtime + compact on close + references = crash?

P: n/a
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

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.