Function NovaGodina(Godina) Dim Db As Database, NovaDb As Database Dim SQL As String Dim RS As Recordset Dim PutanjaBaza As String, Putanja As String, ImeNoveBaze As String Dim SL_Pocetna As Recordset, SL_Zavrsna As Recordset, SL_Pomocna As Recordset Dim Tablica As String Dim Tablica_2 As String Set Db = CurrentDb() SQL = "SELECT TOP 1 Database " _ & "FROM MSysObjects " _ & "WHERE Database Is Not Null" Set RS = Db.OpenRecordset(SQL) Putanja = RS.Fields(0) RS.Close 'be.sys mora biti u direktoriju u kojem je i linkovana baza PutanjaBaza = Put_Baza(Putanja) ImeNoveBaze = "Prodaja_" & Godina & "_be.mdb" If Dir(PutanjaBaza & ImeNoveBaze) = "" Then FileCopy PutanjaBaza & "be.sys", PutanjaBaza & ImeNoveBaze Set NovaDb = OpenDatabase(PutanjaBaza & ImeNoveBaze) Else MsgBox "Baza ve postoji" Exit Function End If