VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Form4 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Sistem Informasi Kriminalitas()"
   ClientHeight    =   6735
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   9630
   LinkTopic       =   "Form6"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   6735
   ScaleWidth      =   9630
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame2 
      Height          =   765
      Left            =   0
      TabIndex        =   17
      Top             =   0
      Width           =   9615
      Begin VB.CommandButton Command3 
         Height          =   555
         Left            =   1920
         Picture         =   "Form4.frx":0000
         Style           =   1  'Graphical
         TabIndex        =   21
         ToolTipText     =   "Tutup"
         Top             =   150
         Width           =   555
      End
      Begin VB.CommandButton Command2 
         Height          =   555
         Left            =   1320
         Picture         =   "Form4.frx":0442
         Style           =   1  'Graphical
         TabIndex        =   20
         ToolTipText     =   "Cetak Ke Printer"
         Top             =   150
         Width           =   585
      End
      Begin VB.CommandButton Command1 
         Height          =   555
         Left            =   60
         Picture         =   "Form4.frx":0884
         Style           =   1  'Graphical
         TabIndex        =   19
         ToolTipText     =   "Revie"
         Top             =   150
         Width           =   645
      End
      Begin VB.CommandButton Command4 
         Height          =   555
         Left            =   720
         Picture         =   "Form4.frx":0CC6
         Style           =   1  'Graphical
         TabIndex        =   18
         ToolTipText     =   "Batal"
         Top             =   150
         Width           =   585
      End
   End
   Begin VB.Frame Frame3 
      Height          =   4395
      Left            =   0
      TabIndex        =   3
      Top             =   2340
      Width           =   9615
      Begin VB.Frame Frame4 
         Height          =   1995
         Left            =   6930
         TabIndex        =   7
         Top             =   2310
         Width           =   2625
         Begin VB.TextBox Text1 
            BackColor       =   &H00FFC0C0&
            Height          =   375
            Left            =   270
            TabIndex        =   8
            Top             =   1200
            Width           =   2145
         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            =   900
            TabIndex        =   12
            Top             =   1590
            Width           =   825
         End
         Begin VB.Label Label3 
            Appearance      =   0  'Flat
            BackColor       =   &H80000016&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Mengetahui"
            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            =   750
            TabIndex        =   11
            Top             =   510
            Width           =   1095
         End
         Begin VB.Label Label5 
            Appearance      =   0  'Flat
            BackColor       =   &H80000016&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Tanggal"
            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            =   90
            TabIndex        =   10
            Top             =   150
            Width           =   765
         End
         Begin VB.Label Label4 
            Appearance      =   0  'Flat
            BorderStyle     =   1  'Fixed Single
            BeginProperty DataFormat 
               Type            =   1
               Format          =   "dd MMMM yyyy"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   3
            EndProperty
            BeginProperty Font 
               Name            =   "Times New Roman"
               Size            =   8.25
               Charset         =   255
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H80000008&
            Height          =   345
            Left            =   870
            TabIndex        =   9
            Top             =   150
            Width           =   1635
         End
      End
      Begin VB.Frame Frame5 
         Height          =   615
         Left            =   2430
         TabIndex        =   4
         Top             =   2310
         Width           =   4425
         Begin VB.TextBox Text2 
            Appearance      =   0  'Flat
            BackColor       =   &H00FFC0C0&
            Height          =   375
            Left            =   2040
            TabIndex        =   5
            Top             =   150
            Width           =   1695
         End
         Begin VB.Label Label7 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Total Kejadian"
            BeginProperty Font 
               Name            =   "Times New Roman"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   -1  'True
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H80000008&
            Height          =   375
            Left            =   60
            TabIndex        =   6
            Top             =   150
            Width           =   1965
         End
      End
      Begin MSHierarchicalFlexGridLib.MSHFlexGrid info 
         Height          =   2115
         Left            =   60
         TabIndex        =   13
         Top             =   180
         Width           =   9495
         _ExtentX        =   16748
         _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 Frame1 
      Height          =   1125
      Left            =   1860
      TabIndex        =   0
      Top             =   810
      Width           =   5415
      Begin VB.Label Label9 
         Caption         =   "Laporan Bulanan Data 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            =   1320
         TabIndex        =   16
         Top             =   810
         Width           =   3195
      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        =   2
         Top             =   180
         Width           =   2805
      End
      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        =   1
         Top             =   510
         Width           =   2805
      End
   End
   Begin MSComCtl2.DTPicker tgl 
      Height          =   375
      Left            =   4380
      TabIndex        =   14
      Top             =   1950
      Width           =   1245
      _ExtentX        =   2196
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      CalendarBackColor=   -2147483624
      CalendarForeColor=   -2147483647
      CalendarTitleBackColor=   -2147483635
      CalendarTitleForeColor=   -2147483625
      CalendarTrailingForeColor=   65280
      CustomFormat    =   "MM/yyyy"
      Format          =   24510467
      CurrentDate     =   38168
   End
   Begin VB.Label Label11 
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Bulan"
      Height          =   375
      Left            =   3690
      TabIndex        =   15
      Top             =   1950
      Width           =   675
   End
End
Attribute VB_Name = "Form4"
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 Command1_Click()
ClearInfo
  no = 0
  info.Row = 1
  total = 0
  Set rec = db.OpenRecordset("select * from tkriminal where month(tgl_kejadian)= month('" & Format(tgl.Value, "MM/yy") & "') and year(tgl_kejadian)=year('" & Format(tgl.Value, "MM/yy") & "')")
  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 nm_pelaku from tpelaku where kd_pelaku='" & rec(1) & "'")
     info.Col = 3: info.Text = cari(0)
    Set cari = Nothing
    info.Col = 4: info.Text = rec(2)
    info.Col = 5: info.Text = Format(rec(3), "dd/mmm/yyyy")
    info.Col = 6: info.Text = rec(4)
    total = total + 1
    info.Rows = info.Rows + 1
    info.Row = info.Row + 1
    rec.MoveNext
  Loop
  Text2 = Val(total)
  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(Text2.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 * from tkriminal where month(tgl_kejadian)= month('" & Format(tgl.Value, "MM/yy") & "') and year(tgl_kejadian)=year('" & Format(tgl.Value, "MM/yy") & "')")
  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 Kriminalitas Bulanan", 112)
        Debug.Print Tab(10); FCenter("Bulan : " & Format(tgl.Value, "mmmm/yyyy") & "", 112)
        Debug.Print
        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); "|"; "Kd Pelaku"; _
                    Tab(38); "|"; "Nama Pelaku"; _
                    Tab(60); "|"; "Nomor Pasal"; _
                    Tab(73); "|"; "Tgl Kejadian"; _
                    Tab(88); "|"; "Tempat Kejadian"; _
                    Tab(111); "|"
        Debug.Print Tab(10); grs2
      End If
      Set cari = db.OpenRecordset("select nm_pelaku from tpelaku where kd_pelaku='" & rec(1) & "'")
       
      
        Debug.Print Tab(10); "|"; no; _
                    Tab(14); "|"; rec(0); _
                    Tab(26); "|"; rec(1); _
                    Tab(38); "|"; cari(0); _
                    Tab(60); "|"; rec(2); _
                    Tab(73); "|"; Format(rec(3), "dd/mmm/yyyy"); ; _
                    Tab(88); "|"; rec(4); _
                    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 Tab(10); "Total Kejadian :"; Val(total)
    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 = ""
End Sub

Private Sub Form_Activate()
Label4.Caption = Format(Now, "dd / mmmm / yyyy")
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 = "Kode Pelaku"
  info.Col = 3: info.Text = "Nama Pelaku"
  info.Col = 4: info.Text = "Nomor Pasal"
  info.Col = 5: info.Text = "Tanggal Kejadian"
  info.Col = 6: info.Text = "       T K P"
  info.ColWidth(0) = 500
  info.ColWidth(1) = 1200
  info.ColWidth(2) = 1200
  info.ColWidth(3) = 2000
  info.ColWidth(4) = 1500
  info.ColWidth(5) = 1500
  info.ColWidth(6) = 1200
End Sub

Private Sub Form_Load()
  ClearInfo
End Sub






