Function Shema()
Dim db As DAO.Database
Dim Sl_Table1 As DAO.Recordset
Dim rs As DAO.Recordset
Dim rs2 As DAO.Recordset
Dim Uslov As String
'------------------------------------
Dim Pr As C_Progres, a As Boolean
'-----------------------------------------------------------
'Uslov = Form_PitaIzdatnicu.IDPoz
CurrentDb.Execute "DELETE*FROM [Shema]"
CurrentDb.Execute "DELETE*FROM [ShemaTransfer]"
DoCmd.Hourglass True
Set db = CurrentDb()
Select Case IDKategorije
Case 0
Set Pr = New C_Progres
Pr.SkalaDo = 8
DoCmd.OpenQuery "kStroj-grupa 00 append", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "kStroj-grupa 01 append", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "kStroj-grupa 02 append", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "kStroj-grupa 03 append", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "kStroj-grupa 04 append", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "kStroj-grupa 05 append", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "kStroj-grupa 06 append", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "kStroj-grupa 07 append", acNormal, acEdit
a = Pr.StartP
Case 1
Set Pr = New C_Progres
Pr.SkalaDo = 8
DoCmd.OpenQuery "st10-Shema-Stroj-Sklop-Podsklop-Cvor", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "st11-Shema-Stroj-Sklop-Podsklop", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "st12-Shema-Stroj-Sklop-Cvor", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "st13-Shema-Stroj-Sklop", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "st14-Shema-Stroj-Podsklop-Cvor", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "st15-Shema-Stroj-Podsklop", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "st16-Shema-Stroj-Cvor", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "st17-Shema-Stroj", acNormal, acEdit
a = Pr.StartP
Case 2
Set Pr = New C_Progres
Pr.SkalaDo = 4
DoCmd.OpenQuery "sk300-Shema-Sklop-Podsklop-Cvor", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "sk301-Shema-Sklop-Podsklop", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "sk302-Shema-Sklop-Cvor", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "sk303-Shema-Sklop", acNormal, acEdit
a = Pr.StartP
Case 3
Set Pr = New C_Progres
Pr.SkalaDo = 2
DoCmd.OpenQuery "ps500-Shema-Podsklop-Cvor", acNormal, acEdit
a = Pr.StartP
DoCmd.OpenQuery "ps501-Shema-Podsklop", acNormal, acEdit
Case 4
DoCmd.OpenQuery "cv700-Shema-Cvor", acNormal, acEdit
a = Pr.StartP
End Select
DoCmd.Hourglass False
Set db = CurrentDb()
Set Sl_Table1 = db.OpenRecordset("QryShema", dbOpenDynaset)
If Sl_Table1.RecordCount <= 0 Then
MsgBox "Šema za ovu tehnološku cijelinu nije složena", vbInformation, "Informacija"
GoTo Kraj
Else
'--------------------------'
Slozi ' Poziva se funkcija SLOZI '
'--------------------------'
End If
Kraj:
Set db = Nothing
End Function