Private Sub Command0_Click() Dim strSQL2 As String Dim rs2 As DAO.Recordset Dim DB2 As DAO.Database Set DB2 = CurrentDb() Dim racun strSQL2 = "SELECT * FROM tblMaticniList WHERE [SifSluzba]='" & Me.SifSluzba & "'" Set rs2 = DB2.OpenRecordset(strSQL2, dbOpenDynaset) With rs2 .MoveFirst racun = rs2!MatBroj racun = Right("0001", 4) Do While Not .EOF rs2.Edit rs2!MatBroj = racun & "/" & Me.Godina rs2.Update racun = Format$(CInt(racun + 1), "0000") rs2.MoveNext Loop End With rs2.Close DB2.Close Set rs2 = Nothing Set DB2 = Nothing End Sub