Neal Kling
nkling at co.montgomery.ny.us
Fri May 30 10:04:05 CDT 2003
Here's what I use to programatically refresh references. Might be useful for someone. 'Returns : True on successful completion 'Created by: Neal A. Kling 'Created : 4/29/99 11:19:30 AM Function RefreshRefs() As Boolean On Error GoTo Err_RefreshRefs Dim R As Reference Dim r1 As Reference Dim S As String For Each R In Application.References If R.Name <> "Access" And R.Name <> "VBA" Then Set r1 = R Exit For End If Next S = r1.FullPath References.Remove r1 References.AddFromFile S RefreshRefs = True Exit_RefreshRefs: On Error Resume Next Exit Function Err_RefreshRefs: Select Case Err Case 0 'insert Errors you wish to ignore here Resume Next Case Else 'All other errors will trap Beep MsgBox Err.Number & "; " & Err.Description, , "Error in function basReferenceFunctions.RefreshRefs" Resume Exit_RefreshRefs End Select Resume 0 'FOR TROUBLESHOOTING End Function Neal Kling Lotus, isn't that some kind of fancy flower? -----Original Message----- From: Don Elliker [mailto:delliker at hotmail.com] Sent: Friday, May 30, 2003 10:46 AM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Failure to open database file Is it really necessary to check them ALL to do this 'kick-in-the-pants" reference repair ? Won't adding a couple do the trick, supposing that the needed refs are there in the first place, of course. _D