|
Private Sub ZAGRUZKA_SPRAVOCHNIKOV_BTN_Click() ' CLN_TBL.mdb Dim tdf As DAO.TableDef Dim BD_1 As DAO.Database ' Dim BD_2 As DAO.Database ' Dim Table_Name ' Dim Pole_Name ' If VOPROS(" ?") = False Then Exit Sub If VOPROS(" ?") = False Then Exit Sub MESS " " STR_FILTER = " " & Chr$(0) & "*.mdb" & Chr$(0) TEMP_PATCH_TO_BASE = FileOpenSave(OFN_OVERWRITEPROMPT, CurrentProject.Path, STR_FILTER, , ".mdb", , " CLN_TBL.mdb", -1, True) If Nz(TEMP_PATCH_TO_BASE) <> "" Then If InStr(1, TEMP_PATCH_TO_BASE, "CLN_TBL", vbTextCompare) <> 0 Then Set BD_1 = CurrentDb ' Set BD_2 = OpenDatabase(TEMP_PATCH_TO_BASE) ' For Each tdf In BD_2.TableDefs If Mid(tdf.Name, 1, 4) <> "Msys" Then ' For Each objField In BD_2.TableDefs(tdf.Name).Fields Table_Name = tdf.Name Pole_Name = objField.Name ' . ? MsgBox CurrentDb.TableDefs(Table_Name).Fields(Pole_Name).Value BD_1.TableDefs(Table_Name).Fields(Pole_Name)=BD_2.TableDefs(tdf.Name).Fields(objField.Name) Next End If Next tdf BD_1.Close Set BD_1 = Nothing BD_2.Close Set BD_2 = Nothing Else MESS " ." Exit Sub End If Else MESS " ." Exit Sub End If End Sub
http://www.sql.ru/forum/1232258/perebros-dannyh-iz-drugoy-bazy