Any ideas on why this is happening?
Steve Schlotter <ste...@coloradocustomware.com> wrote in message
news:38ee3955$1...@news.webaccess.net...
"Joe Fallon" <jfal...@nospamtwcny.rr.com> wrote in message
news:eyvkbwRo$GA.256@cppssbbsa05...
I'll admit, when I have messed with references before, if they're broken - I pop a note and shut down the application. They'll call soon enough and we can find out what's up.
Steve
Private Sub Form_Load()
Dim ref As Reference
Dim blnBadRef As Boolean
On Error GoTo errForm_Load
For Each ref In References 'check for broken references
If ref.IsBroken Then
Debug.Print ref.FullPath 'just for checking, to get you going on where they are, etc.
Debug.Print ref.Guid
Debug.Print ref.BuiltIn
Debug.Print ref.Name
Select Case ref.Name 'easier than typing the GUID
Case "C:\Program Files\Microsoft Office\Office\MSWORD9.OLB"
References.Remove ref 'HEY! READ THE CODE, THIS IS A REFERENCE KILLER HERE!
References.AddFromFile "Full Path and name to Word 8 file"
Case "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB"
References.Remove ref 'HEY! READ THE CODE, THIS IS A REFERENCE KILLER HERE!
References.AddFromFile "Full Path and name to Excel 8 file"
Case Else
MsgBox "References Error, call Tech Support"
blnBadRef = True
End Select
End If
Next
Exit_Form_Load:
If blnBadRef Then
DoCmd.Quit
Else
DoCmd.OpenForm "frmSwitchboard"
DoCmd.Close acForm, "frmOpenMeFirst"
End If
Exit Sub
errForm_Load:
Select Case Err.Number
Case 48 'missing DLL
Resume Next
Case Else
Resume Exit_Form_Load
End Select
End Sub
Steve Schlotter <ste...@coloradocustomware.com> wrote in message news:38f20050$1...@news.webaccess.net...