VERSION 5.00
Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX"
Begin VB.Form frmLapWali 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Daftar Wali Kelas..."
   ClientHeight    =   1905
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4650
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   1905
   ScaleWidth      =   4650
   Begin VB.CommandButton cmdTutup 
      BackColor       =   &H00D8E9EC&
      Caption         =   "&Tutup"
      Height          =   405
      Left            =   3600
      TabIndex        =   6
      Top             =   1440
      Width           =   945
   End
   Begin VB.CommandButton cmdPrint 
      BackColor       =   &H00D8E9EC&
      Caption         =   "&Print"
      Height          =   405
      Left            =   2640
      TabIndex        =   5
      Top             =   1440
      Width           =   945
   End
   Begin VB.Frame Frame1 
      Caption         =   "- Pilih Kriteria Laporan -"
      Height          =   1215
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   4455
      Begin VB.ComboBox cmbKelas 
         Enabled         =   0   'False
         Height          =   315
         Left            =   2880
         TabIndex        =   4
         Top             =   720
         Width           =   1215
      End
      Begin VB.ComboBox cmbTahun 
         Height          =   315
         Left            =   1200
         TabIndex        =   3
         Top             =   720
         Width           =   1215
      End
      Begin VB.OptionButton Option2 
         Caption         =   "Kode Kelas:"
         Height          =   195
         Left            =   2880
         TabIndex        =   2
         Top             =   480
         Width           =   1455
      End
      Begin VB.OptionButton Option1 
         Caption         =   "Tahun Ajaran"
         Height          =   195
         Left            =   1200
         TabIndex        =   1
         Top             =   480
         Width           =   1455
      End
   End
   Begin Crystal.CrystalReport CrtLaporan 
      Left            =   240
      Top             =   1440
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   348160
      PrintFileLinesPerPage=   60
   End
End
Attribute VB_Name = "frmLapWali"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Sub DaftarKelas()
Me.MousePointer = 11
    Set TNilai = New ADODB.Recordset
        Kata = "Select Distinct [Kelas] from Qwali Order By [Kelas]"
        TNilai.Open Kata, Datasiswa, adOpenDynamic, adLockPessimistic
        cmbKelas.Clear
        If Not TNilai.EOF Then
           TNilai.MoveFirst
           While Not TNilai.EOF
                cmbKelas.AddItem TNilai![Kelas]
                TNilai.MoveNext
            Wend
        End If
        TNilai.Close
        Set TNilai = Nothing

    Me.MousePointer = 1

End Sub

Sub DaftarGuru()
Me.MousePointer = 11
    Set TGuru = New ADODB.Recordset
        Kata = "Select * from [Wali kelas] Order By [NIP]"
        TGuru.Open Kata, Datasiswa, adOpenDynamic, adLockPessimistic
        cmbNIP.Clear
        If Not TGuru.EOF Then
           TGuru.MoveFirst
           While Not TGuru.EOF
                cmbNIP.AddItem TGuru![NIP]
                TGuru.MoveNext
            Wend
        End If
        TGuru.Close
        Set TGuru = Nothing

    Me.MousePointer = 1

End Sub

Sub DaftarAjaran()
Me.MousePointer = 11
    Set TNilai = New ADODB.Recordset
        Kata = "Select Distinct [Tahun Ajaran] from [Wali kelas] Order By [Tahun Ajaran]"
        TNilai.Open Kata, Datasiswa, adOpenDynamic, adLockPessimistic
        cmbTahun.Clear
        If Not TNilai.EOF Then
           TNilai.MoveFirst
           While Not TNilai.EOF
                cmbTahun.AddItem TNilai![tahun ajaran]
                TNilai.MoveNext
            Wend
        End If
        TNilai.Close
        Set TNilai = Nothing

    Me.MousePointer = 1

End Sub

    

Private Sub cmbKelas_Click()
If cmbKelas.Text <> "" Then
cmdPrint.Enabled = True
cmdPrint.SetFocus
End If
End Sub



Private Sub cmbTahun_Click()
If cmbTahun.Text <> "" Then
    cmdPrint.Enabled = True
    cmdPrint.SetFocus
End If
End Sub

Private Sub cmdPrint_Click()
On Error GoTo Salah
    Me.MousePointer = 11
    
    If cmbTahun.Enabled = True Then
        With CrtLaporan
            .Reset
            .ReportFileName = App.Path & "\Lap Wali.rpt"
            .DataFiles(0) = App.Path & "\Siswa.mdb"
            .SelectionFormula = "{QWali.Tahun Ajaran}='" & cmbTahun.Text & "'"
            .WindowMinButton = False
            .WindowShowCancelBtn = True
            .WindowShowCloseBtn = True
            .WindowShowPrintBtn = True
            .WindowShowPrintSetupBtn = True
            .WindowParentHandle = frmUtama.hWnd
            .WindowState = crptMaximized
            .Action = 1
                   
        End With
    
    Else
        With CrtLaporan
            .Reset
            .ReportFileName = App.Path & "\Lap Wali.rpt"
            .DataFiles(0) = App.Path & "\Siswa.mdb"
            .SelectionFormula = "{QWali.Kelas}='" & cmbKelas.Text & "'"
            .WindowMinButton = False
            .WindowShowCancelBtn = True
            .WindowShowCloseBtn = True
            .WindowShowPrintBtn = True
            .WindowShowPrintSetupBtn = True
            .WindowParentHandle = frmUtama.hWnd
            .WindowState = crptMaximized
            .Action = 1
            
        End With
   
    End If
    Me.MousePointer = 1
    Exit Sub
Salah:
    MsgBox Err.Description

End Sub

Private Sub cmdTutup_Click()
Unload Me
End Sub

Private Sub Form_Load()
Ketengah Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set frmLapWali = Nothing
Unload Me
End Sub

Private Sub Option1_Click()

cmbKelas.Clear
cmbKelas.Enabled = False
cmdPrint.Enabled = False
DaftarAjaran
cmbTahun.Enabled = True
cmbTahun.SetFocus
End Sub

Private Sub Option2_Click()

cmbTahun.Clear
cmbTahun.Enabled = False
cmdPrint.Enabled = False
DaftarKelas
cmbKelas.Enabled = True
cmbKelas.SetFocus

End Sub



