VERSION 5.00
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Form5 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Sistem Informasi Kriminalitas()"
   ClientHeight    =   5850
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   8460
   LinkTopic       =   "Form5"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   5850
   ScaleWidth      =   8460
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame6 
      Height          =   945
      Left            =   0
      TabIndex        =   13
      Top             =   1800
      Width           =   8445
      Begin VB.TextBox Text5 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00004040&
         Height          =   375
         Left            =   5580
         TabIndex        =   20
         Top             =   150
         Width           =   2805
      End
      Begin VB.TextBox Text6 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00004040&
         Height          =   375
         Left            =   5580
         TabIndex        =   19
         Top             =   540
         Width           =   1695
      End
      Begin VB.TextBox Text2 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000012&
         Height          =   375
         Left            =   1500
         TabIndex        =   16
         Top             =   510
         Width           =   2775
      End
      Begin VB.ComboBox Combo1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000018&
         Height          =   315
         ItemData        =   "Form5.frx":0000
         Left            =   1500
         List            =   "Form5.frx":0002
         TabIndex        =   15
         Top             =   180
         Width           =   1455
      End
      Begin VB.Label Label5 
         Appearance      =   0  'Flat
         BackColor       =   &H80000016&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "Alamat "
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   4860
         TabIndex        =   22
         Top             =   150
         Width           =   705
      End
      Begin VB.Label Label4 
         Appearance      =   0  'Flat
         BackColor       =   &H80000016&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "Jenis Kelamin"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   4380
         TabIndex        =   21
         Top             =   540
         Width           =   1185
      End
      Begin VB.Label Label3 
         Appearance      =   0  'Flat
         BackColor       =   &H80000016&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "Kode Pelaku"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   315
         Left            =   90
         TabIndex        =   18
         Top             =   180
         Width           =   1395
      End
      Begin VB.Label Label12 
         Appearance      =   0  'Flat
         BackColor       =   &H80000016&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "Nama Pelaku"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   210
         TabIndex        =   17
         Top             =   510
         Width           =   1275
      End
   End
   Begin VB.Frame Frame1 
      Height          =   1005
      Left            =   1410
      TabIndex        =   9
      Top             =   780
      Width           =   5415
      Begin VB.Label Label2 
         Caption         =   "Sektor Palembayan"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1980
         TabIndex        =   12
         Top             =   450
         Width           =   2805
      End
      Begin VB.Label Label1 
         Caption         =   "Polri Daerah Sumatera Barat"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   345
         Left            =   1560
         TabIndex        =   11
         Top             =   180
         Width           =   2805
      End
      Begin VB.Label Label9 
         Caption         =   "Laporan Per Kode Pelaku Kriminalitas"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1170
         TabIndex        =   10
         Top             =   690
         Width           =   3195
      End
   End
   Begin VB.Frame Frame3 
      Height          =   3045
      Left            =   -30
      TabIndex        =   5
      Top             =   2790
      Width           =   8475
      Begin VB.Frame Frame4 
         Caption         =   "Kapolsek"
         Height          =   615
         Left            =   5790
         TabIndex        =   6
         Top             =   2340
         Width           =   2625
         Begin VB.TextBox Text1 
            BackColor       =   &H00FFC0C0&
            Height          =   375
            Left            =   60
            TabIndex        =   7
            Top             =   180
            Width           =   2505
         End
         Begin VB.Label Label6 
            Appearance      =   0  'Flat
            BackColor       =   &H80000016&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Kapolsek"
            BeginProperty Font 
               Name            =   "Times New Roman"
               Size            =   9
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   -1  'True
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H80000008&
            Height          =   345
            Left            =   870
            TabIndex        =   14
            Top             =   750
            Width           =   825
         End
      End
      Begin MSHierarchicalFlexGridLib.MSHFlexGrid info 
         Height          =   2115
         Left            =   60
         TabIndex        =   8
         Top             =   180
         Width           =   8355
         _ExtentX        =   14737
         _ExtentY        =   3731
         _Version        =   393216
         BackColor       =   -2147483624
         Rows            =   3
         Cols            =   3
         BackColorFixed  =   14737632
         BackColorSel    =   16744703
         BackColorBkg    =   16761024
         BackColorUnpopulated=   12640511
         _NumberOfBands  =   1
         _Band(0).Cols   =   3
      End
   End
   Begin VB.Frame Frame2 
      Height          =   765
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   8475
      Begin VB.CommandButton Command4 
         Height          =   555
         Left            =   720
         Picture         =   "Form5.frx":0004
         Style           =   1  'Graphical
         TabIndex        =   4
         ToolTipText     =   "Batal"
         Top             =   150
         Width           =   585
      End
      Begin VB.CommandButton Command1 
         Height          =   555
         Left            =   60
         Picture         =   "Form5.frx":0446
         Style           =   1  'Graphical
         TabIndex        =   3
         ToolTipText     =   "Revie"
         Top             =   150
         Width           =   645
      End
      Begin VB.CommandButton Command2 
         Height          =   555
         Left            =   1320
         Picture         =   "Form5.frx":0888
         Style           =   1  'Graphical
         TabIndex        =   2
         ToolTipText     =   "Cetak Ke Printer"
         Top             =   150
         Width           =   585
      End
      Begin VB.CommandButton Command3 
         Height          =   555
         Left            =   1920
         Picture         =   "Form5.frx":0CCA
         Style           =   1  'Graphical
         TabIndex        =   1
         ToolTipText     =   "Tutup"
         Top             =   150
         Width           =   555
      End
   End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim no, hal, brs As Integer
Dim total, a As Currency
Dim rec As Recordset
Dim cari As Recordset

Private Sub Combo1_Click()
On Error Resume Next
Set rec = db.OpenRecordset("select nm_pelaku,alm_pelaku,j_kelamin from tpelaku where kd_pelaku='" & Combo1.Text & "'")
 Text2.Text = rec(0)
 Text5.Text = rec(1)
 Text6.Text = IIf(rec(2) = "L", "Laki-Laki", "Perempuan")
Set rec = Nothing
End Sub

Private Sub Command1_Click()
ClearInfo
  no = 0
  info.Row = 1
   Set rec = db.OpenRecordset("select no_berkas,no_pas,tgl_kejadian,tkp from tkriminal where kd_pelaku='" & Combo1.Text & "'")
  If Not rec.EOF Then
    rec.MoveFirst
    Do While Not rec.EOF
    no = no + 1
    info.Col = 0: info.Text = no
    info.Col = 1: info.Text = rec(0)
    info.Col = 2: info.Text = rec(1)
    Set cari = db.OpenRecordset("select td_pidana,ket from tpasal where no_pas='" & rec(1) & "'")
    info.Col = 3: info.Text = cari(0)
    info.Col = 4: info.Text = cari(1)
    info.Col = 5: info.Text = Format(rec(2), "dd/mmm/yyyy")
    info.Col = 6: info.Text = rec(3)
    Set cari = Nothing
    info.Rows = info.Rows + 1
    info.Row = info.Row + 1
    rec.MoveNext
  Loop
  End If
  If no = 0 Then
    Call ClearInfo
  Else
    info.Rows = info.Rows - 1
  End If
End Sub

Private Sub Command2_Click()
If Trim(Text1.Text) = "" Or Trim(Combo1.Text) = "" Then
 MsgBox "Lengkapi Data dan Inputkan Nama Pimpinan terlebih dahulu", vbInformation + vbOKOnly
 Text1.SetFocus
Else
Dim grs1, grs2 As String
  Dim dataada As Boolean
  Dim ms As Byte
  'On Error GoTo salahcetak:
  dataada = False
  hal = 0: brs = 0: no = 0
  'Printer.Orientation = vbPRORPortrait
  'Printer.PaperSize = vbPRPSLegal
  'Printer.Font = "lucida console"
  'Printer.FontSize = 9
 Set rec = db.OpenRecordset("select no_berkas,no_pas,tgl_kejadian,tkp from tkriminal where kd_pelaku='" & Combo1.Text & "'")
  grs2 = String(102, "=")
  If Not rec.EOF Then
    rec.MoveFirst
    Do While Not rec.EOF
    no = no + 1
      brs = brs + 1
      If brs = 1 Then
        hal = hal + 1
        If hal > 1 Then
          Debug.Print Tab(10); grs2
          'Printer.EndDoc
          'Printer.Orientation = vbPRORlandscape
          'Printer.PaperSize = vbPRPSLegal
          'Printer.Font = "lucida console"
          'Printer.FontSize = 9
        End If
        dataada = True
        Debug.Print String(2, Chr(13))
        Debug.Print Tab(10); FCenter("Polri Daerah Sumatera Barat", 112)
        Debug.Print Tab(10); FCenter("Laporan Per-Kode Pelaku Kriminalitas", 112)
        Debug.Print
        Debug.Print
        Debug.Print
        Debug.Print Tab(10); "Kode Pelaku   : " & Combo1.Text
        Debug.Print Tab(10); "Nama PElaku   : " & Text2.Text
        Debug.Print Tab(10); "Alamat        : " & Text5.Text
        Debug.Print Tab(10); "Jenis Kelamin : " & Text6.Text
        Debug.Print
        Debug.Print Tab(104); "hal: "; RKanan(hal, "###")
        Debug.Print Tab(10); grs2
        Debug.Print Tab(10); "|"; "No."; _
                    Tab(14); "|"; "No Berkas"; _
                    Tab(26); "|"; "Nomor Pasal"; _
                    Tab(38); "|"; "Tindak Pidana"; _
                    Tab(60); "|"; "Hukuman"; _
                    Tab(73); "|"; "Tgl Kejadian"; _
                    Tab(88); "|"; "Tempat Kejadian"; _
                    Tab(111); "|"
        Debug.Print Tab(10); grs2
      End If
      Set cari = db.OpenRecordset("select td_pidana,ket from tpasal where no_pas='" & rec(1) & "'")
                    
      Debug.Print Tab(10); "|"; no; _
                    Tab(14); "|"; rec(0); _
                    Tab(26); "|"; rec(1); _
                    Tab(38); "|"; cari(0); _
                    Tab(60); "|"; cari(1); _
                    Tab(73); "|"; Format(rec(2), "dd/mmm/yyyy"); ; _
                    Tab(88); "|"; rec(3); _
                    Tab(111); "|";
      If brs = 60 Then
        brs = 0
      End If
     rec.MoveNext
  Loop
  End If
  If dataada Then
    Debug.Print Tab(10); grs2
    Debug.Print
    Debug.Print
    Debug.Print
    Debug.Print Tab(88); "Palembayan, "; Format(Now, "dd/mmmm/yyyy")
    Debug.Print Tab(88); "Kapolsek"
    Debug.Print
    Debug.Print
    Debug.Print
    Debug.Print Tab(88); "(" & Text1.Text & ")"
  End If
  'Printer.EndDoc
  Exit Sub
salahcetak:
  Beep
  ms = MsgBox("Printer Error" & Chr(13) & "Betulkan printer lalu klik OK !", vbCritical + vbOKCancel, "Error")
  If ms = vbOK Then
    Resume
  Else
    Printer.KillDoc
  End If
End If
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
ClearInfo
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.Text = ""
Combo1.Text = ""
End Sub

Private Sub ClearInfo()
  info.Clear
  info.Rows = 2
  info.Cols = 7
  info.Row = 0
  info.Col = 0: info.Text = "No"
  info.Col = 1: info.Text = "Nomor Berkas"
  info.Col = 2: info.Text = "Nomor Pasal"
  info.Col = 3: info.Text = "Tindak Pidana"
  info.Col = 4: info.Text = "Hukuman"
  info.Col = 5: info.Text = "Tgl Kejadian"
  info.Col = 6: info.Text = "       T K P"
  info.ColWidth(0) = 500
  info.ColWidth(1) = 1200
  info.ColWidth(2) = 1200
  info.ColWidth(3) = 1500
  info.ColWidth(4) = 1500
  info.ColWidth(5) = 1200
  info.ColWidth(6) = 1500
End Sub

Private Sub Form_Load()
Set rect = db.OpenRecordset("select * from tpelaku order by kd_pelaku")
 ClearInfo
 If rect.RecordCount <> 0 Then rect.MoveFirst
 Do While Not rect.EOF
  Combo1.AddItem rect(0)
  rect.MoveNext
 Loop
Set rect = Nothing
End Sub








