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 Dim ImeNoveBaze 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 PutanjaBaza = Put_Baza(Putanja) ImeNoveBaze = "Skladiste_" & Godina & "_be.mdb" FileCopy PutanjaBaza & "be.sys", PutanjaBaza & ImeNoveBaze Set NovaDb = OpenDatabase(PutanjaBaza & ImeNoveBaze) 'I sad dolazi tvoj kod za presnimavanje stanja 'stim da koristis svoju postojecu db i novadb za prenos u novu bazu. 'Mislim da ces se snaci da popravis svoj kod. End Function Function Put_Baza(Putanja As String) Dim tmp As String tmp = Putanja Do While Right(tmp, 1) <> "\" tmp = Left(tmp, Len(tmp) - 1) Loop Put_Baza = tmp End Function