VERSION 5.00
Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX"
Begin VB.Form frmLapBidang 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Laporan Bidang Studi"
   ClientHeight    =   2205
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4635
   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     =   2205
   ScaleWidth      =   4635
   Begin VB.CommandButton cmdTutup 
      BackColor       =   &H00D8E9EC&
      Caption         =   "&Tutup"
      Height          =   405
      Left            =   3600
      TabIndex        =   8
      Top             =   1680
      Width           =   945
   End
   Begin VB.CommandButton cmdPrint 
      BackColor       =   &H00D8E9EC&
      Caption         =   "&Print"
      Height          =   405
      Left            =   2640
      TabIndex        =   7
      Top             =   1680
      Width           =   945
   End
   Begin VB.Frame Frame1 
      Height          =   1575
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   4455
      Begin VB.ComboBox cmbStudi 
         Height          =   315
         Left            =   2160
         TabIndex        =   6
         Top             =   1080
         Width           =   2175
      End
      Begin VB.OptionButton Option3 
         Caption         =   "Bidang Studi:"
         Height          =   255
         Left            =   720
         TabIndex        =   5
         Top             =   1080
         Width           =   1335
      End
      Begin VB.ComboBox cmbBidang 
         Height          =   315
         Left            =   2160
         TabIndex        =   4
         Top             =   720
         Width           =   1095
      End
      Begin VB.ComboBox cmbNIP 
         Height          =   315
         Left            =   2160
         TabIndex        =   3
         Top             =   360
         Width           =   1815
      End
      Begin VB.OptionButton Option2 
         Caption         =   "Kode Bidang:"
         Height          =   255
         Left            =   720
         TabIndex        =   2
         Top             =   720
         Width           =   1335
      End
      Begin VB.OptionButton Option1 
         Caption         =   "NIP:"
         Height          =   255
         Left            =   720
         TabIndex        =   1
         Top             =   360
         Width           =   1215
      End
   End
   Begin Crystal.CrystalReport CrtLaporan 
      Left            =   240
      Top             =   1560
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   348160
      PrintFileLinesPerPage=   60
   End
End
Attribute VB_Name = "frmLapBidang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Sub DaftarBidang()
Me.MousePointer = 11
    Set TNilai = New ADODB.Recordset
        Kata = "Select Distinct [Kode Bidang] from QStudi Order By [Kode Bidang]"
        TNilai.Open Kata, Datasiswa, adOpenDynamic, adLockPessimistic
        cmbBidang.Clear
        If Not TNilai.EOF Then
           TNilai.MoveFirst
           While Not TNilai.EOF
                cmbBidang.AddItem TNilai![kode Bidang]
                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 Distinct [NIP] from QStudi 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 DaftarStudi()
Me.MousePointer = 11
    Set TNilai = New ADODB.Recordset
        Kata = "Select Distinct [Bidang Studi] from QStudi Order By [Bidang Studi]"
        TNilai.Open Kata, Datasiswa, adOpenDynamic, adLockPessimistic
        cmbStudi.Clear
        If Not TNilai.EOF Then
           TNilai.MoveFirst
           While Not TNilai.EOF
                cmbStudi.AddItem TNilai![Bidang Studi]
                TNilai.MoveNext
            Wend
        End If
        TNilai.Close
        Set TNilai = Nothing

    Me.MousePointer = 1

End Sub

Private Sub cmbBidang_Click()
If cmbBidang.Text <> "" Then
    cmdPrint.Enabled = True
    cmdPrint.SetFocus
End If
End Sub

Private Sub cmbNIP_Click()
If cmbNIP.Text <> "" Then
    cmdPrint.Enabled = True
    cmdPrint.SetFocus
End If
End Sub

Private Sub cmbStudi_Click()
If cmbStudi.Text <> "" Then
    cmdPrint.Enabled = True
    cmdPrint.SetFocus
End If
End Sub

Private Sub cmdPrint_Click()
On Error GoTo Salah
Me.MousePointer = 1

If cmbNIP.Enabled = True Then
    With CrtLaporan
        .Reset
        .ReportFileName = App.Path & "\Lap bidang.rpt"
        .DataFiles(0) = App.Path & "\Siswa.mdb"
        .SelectionFormula = "{Qstudi.NIP}='" & cmbNIP.Text & "'"
        .WindowMinButton = False
        .WindowShowCancelBtn = True
        .WindowShowCloseBtn = True
        .WindowShowPrintBtn = True
        .WindowShowPrintSetupBtn = True
        .WindowParentHandle = frmUtama.hWnd
        .WindowState = crptMaximized
        .Action = 1
        
    End With
    
    
ElseIf cmbBidang.Enabled = True Then

     With CrtLaporan
        .Reset
        .ReportFileName = App.Path & "\Lap bidang.rpt"
        .DataFiles(0) = App.Path & "\Siswa.mdb"
        .SelectionFormula = "{Qstudi.Kode Bidang}='" & cmbBidang.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 bidang.rpt"
        .DataFiles(0) = App.Path & "\Siswa.mdb"
        .SelectionFormula = "{Qstudi.Bidang Studi}='" & cmbStudi.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 frmLapBidang = Nothing
Unload Me
End Sub

Private Sub Option1_Click()
cmbNIP.Enabled = True
cmbNIP.SetFocus
DaftarGuru
cmbBidang.Enabled = True
cmbBidang.Clear
cmbStudi.Clear
cmbStudi.Enabled = False
End Sub

Private Sub Option2_Click()
cmbNIP.Enabled = False
cmbNIP.Clear
DaftarBidang
cmbBidang.Enabled = True
cmbBidang.SetFocus
cmbStudi.Clear
cmbStudi.Enabled = False
End Sub

Private Sub Option3_Click()
DaftarStudi
cmbStudi.Enabled = True
cmbStudi.SetFocus
cmbBidang.Enabled = False
cmbNIP.Enabled = False
End Sub
