I'm not sure where this routine came from,
but here is the problem. On certian computers
this error occurs, but it does not on others.
The error is: "Undefined Function "DIR" in expression".
The form open event calls the CheckandRepairL inks
without a varable being passed it it.
CheckandRepairL inks
The instruction that fails is the Set instruction
pointing to the DIR instruction.
Set RecordSetOfLink s = dbs.OpenRecords et(LinksToPaths SQL)
I really don't know what to do with this because it
is saying it can't find the DOS command "DIR'. In other
forms I have the DIR command and I don't get the error.
Also, I checked and there are no missing references.
Below is a snapshot of the Checkand RepairLinks procedure.
Private Sub CheckandRepairL inks(Optional ByRef dbs As
Database)
' An SQL String To Return a List of Linked DataBases Files
' which cannot be found
Const LinksToPathsSQL As String = _
"SELECT TOP 1 CStr(DataBase) AS DatabaseFile " _
& "FROM MSysObjects " _
& "WHERE Connect Is Null " _
& "AND Left(Name,1) <> '~' " _
& "AND Type = 6 " _
& "AND Len(Dir(CStr(Da taBase))) = 0 " _
& "ORDER BY CStr(DataBase); "
' Message to be sent on Cancel or Exit being chosen from
File Dialog Box
Const FileNotChosenMe ssage As String = _
"No File was Chosen!" _
& vbCrLf _
& "Click OK to Continue " _
& vbCrLf _
& "Click Cancel to Exit Link Checking"
Dim DbsWasPassed As Boolean
Dim NameNotIn As String
Dim RecordSetOfLink s As Recordset
Dim OldPath As String
Dim ButtonSelected As Long
Dim NewPath As String
Dim TableDefinition As TableDef
' display relinking message
'lblVerifyingLo cationofLinkedT ables.Visible = True
DoEvents
If dbs Is Nothing Then
Set dbs = DBEngine(0)(0)
Else
' note if the DataBase was passed
DbsWasPassed = True
End If
' Dummy NameNotIn
NameNotIn = "'" & Chr(255) & "'"
' refresh the tabledefs collection
dbs.TableDefs.R efresh
Do
' Get the first linked lost mdb
Set RecordSetOfLink s = Nothing
' MsgBox LinksToPathsSQL , vbCritical, "Link To Path
SQL"
Set RecordSetOfLink s =
dbs.OpenRecords et(LinksToPaths SQL)
-- Cut
Thanks,
Ron
--
Ronald W. Roberts
Roberts Communication
rw************* ******@robcom.c om
To reply remove "_at_robcom_dot _com"