Ovaj kod kopiraj u neki modul. Option Compare Database Option Explicit Dim Db As Database Function Strojevi(ID As String, Kategorija As Integer) Dim ImeTabele As String Set Db = CurrentDb Db.Execute "DELETE*FROM [Indeks]" Select Case Kategorija Case 0 Kombinacija: ImeTabele = "tblKombinacija" Zapisi ImeTabele, ID GoTo STROJ Case 1 STROJ: ImeTabele = "Stroj" Zapisi ImeTabele, ID GoTo SKLOP Case 2 SKLOP: ImeTabele = "SKLOP" Zapisi ImeTabele, ID GoTo Podsklop Case 3 Podsklop: ImeTabele = "PODSKL" Zapisi ImeTabele, ID GoTo Cvor Case 4 Cvor: ImeTabele = "CVOR" Zapisi ImeTabele, ID End Select End Function