This article applies to a Microsoft Access database (.mdb and .accdb) and to a Microsoft Access project (.adp).
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
- Create a module and type the following line in the Declarations section if it is not already there:
- Type the following procedure:
Dim strMessage As String
Dim strTitle As String
Dim refItem As Reference
On Error Resume Next
For Each refItem In References
If refItem.IsBroken Then
strMessage = "Missing Reference:" & vbCrLf & refItem.FullPath
strMessage = "Reference: " & refItem.Name & vbCrLf _
& "Location: " & refItem.FullPath & vbCrLf
- To test this function, type the following line in the Immediate window, and then press ENTER: Note that each reference is listed in the Immediate window.
For more information about enumerating through the References collection by using the For Each...Next statement, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type next in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
For additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:
Article ID: 209849 - Last Review: Jan 7, 2017 - Revision: 1