Sub LinkAllTblsinDir() '------------------------------------------------------------- Dim sTblNm As String, sPath As String, sFileNm Dim DB As DAO.Database, Tbl As Tabledef Dim ImeT As String, Prefix As String, Putanja As String Dim fd As FileDialog, Fl As Integer '------------------------------------------------------------- Prefix = "dbf_" Set DB = CurrentDb() 'Brisanje For Each Tbl In DB.TableDefs ImeT = Tbl.Name If Left(ImeT, 4) = Prefix Then DoCmd.DeleteObject acTable, ImeT End If Next Tbl 'Upis Set fd = Application.FileDialog(msoFileDialogFilePicker) With fd .AllowMultiSelect = True .Filters.Clear .Filters.Add "Baze", "*.dbf", 1 .Show End With Putanja = fd.InitialFileName For Each sFileNm In fd.SelectedItems If Right(sFileNm, 3) = "dbf" Then sFileNm = Mid(sFileNm, Len(Putanja) + 1) sTblNm = Prefix & Left(sFileNm, Len(sFileNm) - 4) DoCmd.TransferDatabase acImport, "dBase 5.0", Putanja, acTable, sFileNm, sTblNm, False End If Next sFileNm End Sub