Rabu, 23 Maret 2011

Hari ke 52 PI

Query Tampil  :


Private Sub tampil()
mutasi.ListItems.Clear
Set rs = ConnAPP.Execute(" SELECT a.Nama, b.Nma_Kls , c.kde_mutasi, c.kde_siswa, c.kde_kelas, c.Thn_Ajaran, c.Status , c.Semester from Siswa a, Kelas b , Mutasi c where  a.Kde_Siswa = c.Kde_Siswa and b.Kde_Kelas = c.Kde_Kelas")
    While Not rs.EOF
    Set isi = mutasi.ListItems.Add(, , rs!Kde_Mutasi)
    isi.SubItems(1) = rs!Kde_Siswa
    isi.SubItems(2) = rs!Nama
    isi.SubItems(3) = rs!Kde_Kelas
    isi.SubItems(4) = rs!Nma_Kls
    isi.SubItems(5) = rs!Thn_Ajaran
    isi.SubItems(6) = rs!Status
    isi.SubItems(7) = rs!semester
    rs.MoveNext
    Wend
  
End Sub


Query Click :


Private Sub mutasi_Click()

'Set rs = ConnAPP.Execute(" SELECT * FROM mutasi WHERE Kde_Mutasi='" & mutasi.SelectedItem & "'")
'If Not rs.EOF Then
        Text(0) = mutasi.SelectedItem
        Text(1) = mutasi.SelectedItem.SubItems(1)
        Text(3) = mutasi.SelectedItem.SubItems(3)
        Text(4) = mutasi.SelectedItem.SubItems(4)
        Text(5) = mutasi.SelectedItem.SubItems(5)
        Combo.Text = mutasi.SelectedItem.SubItems(6)
        Text(6) = mutasi.SelectedItem.SubItems(7)
    'End If
  
    enbTombol False, False, True, True, True, False, True
  
    Call pasif
End Sub


Private Sub Text_Change(Index As Integer)
Select Case Index

Case 1 'Kode Siswa

Set rs = ConnAPP.Execute(" SELECT * FROM Siswa WHERE Kde_Siswa='" & Text(1) & "'")
If Not rs.EOF Then
    Text(2) = rs!Nama
      
    End If

Case 3 'Kode Kelas

Set rs = ConnAPP.Execute(" SELECT * FROM Kelas WHERE Kde_Kelas='" & Text(3) & "'")
If Not rs.EOF Then
    Text(4) = rs!Nma_Kls
      
    End If


End Select

End Sub

Tidak ada komentar:

Posting Komentar