Dim strMsg As String
Dim strSql As String
Dim rsFilesDead As DAO.Recordset
'Only do the section below if the user did NOT choose a directory to search.
If Not Me.chkDir Then
'SQL below is to identify all records not found in active directory search
strSql = "SELECT tblClips.ID, tblClips.blnAlive " & _
"FROM tblClips LEFT JOIN rsFilesFound ON tblClips.fldLocation = rsFilesFound.fldFileAddress " & _
"WHERE (((tblClips.blnAlive)=True) AND ((rsFilesFound.fldFileAddress) Is Null));"
Set rsFilesDead = CurrentDb.OpenRecordset(strSql)
If rsFilesDead.RecordCount > 0 Then
rsFilesDead.MoveLast
rsFilesDead.MoveFirst
End If
strMsg = MsgBox("The SQL Query contains " & rsFilesDead.RecordCount & " references.", vbOKCancel, "TESTING")
If strMsg = vbCancel Then Exit Sub
'Insert UPDATE Function on rsFilesDead to set the blnAlive field to FALSE.
End If