Solved

Can I report missing references in a msgbox?

Posted on 2004-04-25
7
301 Views
Last Modified: 2012-08-14
I would like to run a check when the mdb loads that will send a list of any missing references in a msgbox on the front end for debugging.  Can this be done?  If so, any suggestions, please?

Thanks!
0
Comment
Question by:earthman100
  • 3
  • 2
  • 2
7 Comments
 
LVL 16

Expert Comment

by:ahmedbahgat
Comment Utility
you may find good info here:

http://www.mvps.org/access/modules/mdl0022.htm

cheers
0
 

Author Comment

by:earthman100
Comment Utility
I tried to install the add-in on that page, but when I run the add-in manager from my Access MDb I get a blank box, and when I close it it says "Subscript out of range".  Then the next time I try it says the wizard cannot be found...

I tried a repair of my Office 2000 installation with no luck.  I also tried to add it in in the references area, but no luck there either.

Any suggestions?
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
some smaple code here

http://www.experts-exchange.com/Databases/MS_Access/Q_20906809.html

use the .IsBroke property to find out missing refs
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
Comment Utility
Ive cut it down, if you have not already done so

Public Sub CheckMissingReferences()
   
    Dim loRef As Access.Reference
    Dim intCount As Integer
    Dim intX As Integer
    Dim blnBroke As Boolean
    Dim strPath As String
    Dim bBroke As Boolean
   
    On Error Resume Next
   
   
    Err.Clear

    'Count the number of references in the database
    intCount = Access.References.Count
   
    'Loop through each reference in the database and determine if the reference is broken.
    'If it is broken, remove the Reference and add it back.
    For intX = intCount To 1 Step -1
       
        Set loRef = Access.References(intX)
        Debug.Print loRef.Name, loRef.FullPath
       
        'Dont do Access
        With loRef
           
            If .IsBroken = True Then
                MsgBox loRef.Name & " is broken" & vbCrLf & loRef.FullPath, vbInformation, "Check"
            End If
           
        End With
    Next
   
    Set loRef = Nothing
   
    Exit Sub
   
rrError:
    MsgBox "Error " & Err.Number & " trapped." & vbCrLf & Err.Description, vbCritical, "Check"
End Sub

0
 
LVL 16

Expert Comment

by:ahmedbahgat
Comment Utility
sorry this addon is for access97 and not 2000, you should follow rockiroads comment


cheers
0
 

Author Comment

by:earthman100
Comment Utility
Worked like a charm, rockiroads.   Thanks for the help!
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
no worries, the first link I gave you will also fix them
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now