1. Ahmad Mustaqim | 12100408 1
kursus
bcancel.Enabled = False
bsave.Enabled = False
End Sub
Sub aktif()
tkode.Enabled = True
tnis.Enabled = True
tnama.Enabled = True
cmapel.Enabled = True
tnominal.Enabled = True
MODUL
binputlagi.Enabled = True
Public dbado As New ADODB.Connection
bcancel.Enabled = True
Public rssiswa As New ADODB.Recordset
bsave.Enabled = True
Public rsbayar As New ADODB.Recordset
End Sub
Public rsdetail As New ADODB.Recordset
Sub bersih()
tkode = ""
Public Sub koneksi()
tnis = ""
If dbado.State = adStateOpen Then
tnama = ""
dbado.Close
cmapel.Text = ""
End If
tnominal = ""
dbado.ConnectionString =
"provider=MSDASQL.1;persist security info=false;data End Sub
source=kursus"
Sub kd()
dbado.Open
Dim code, a, b As String
End Sub
code = "SELECT * from bayar"
Set rsbayar = dbado.Execute(code, , adCmdText)
LISTING
If rsbayar.BOFAndrsbayar.EOF Then
Sub nonaktif()
tkode.Text = "B" &Format(Date, "yymm") & "001"
tkode.Enabled = False
Else
tnis.Enabled = False
a=0
tnama.Enabled = False
rsbayar.MoveFirst
cmapel.Enabled = False
Do Until rsbayar.EOF
tnominal.Enabled = False
a=a+1
binputlagi.Enabled = False
2. Ahmad Mustaqim | 12100408 2
kursus
rsbayar.MoveNext sdetail = "insert into detail_bayar ()values('"
&tkode.Text& "','" &cmapel.Text& "','"
Loop &tnominal.Text& "')"
a=a+1 Set rsdetail = dbado.Execute(sdetail, , adCmdText)
b = Len(Str(a)) tabel
tkode.Text = "B" &Format(Date, "yymm") & cmapel.Text = ""
Mid$("000", 1, 4 - b) & a
tnominal.Text = ""
End If
cmapel.SetFocus
End Sub
End Sub
Sub tabel()
sqlbayar = "select * from detail_bayar"
Private Sub bnew_Click()
Set rsdetail = dbado.Execute(sqlbayar, , adCmdText)
aktif
Set Grid1.DataSource = rsdetail
bersih
End Sub
kd
tnis.SetFocus
Private Sub bcancel_Click()
End Sub
sqldel = "delete from detail_bayar where kode='"
&tkode.Text& "'"
Set rsdetail = dbado.Execute(sqldel, , adCmdText) Private Sub bsave_Click()
tabel Dim save As String
bersih If tnis.Text = "" Then
nonaktif MsgBox ("DATA BELUNG LENGKAP!Silahkan input
nislalu ENTER")
End Sub
tnis.SetFocus
Else
Private Sub bclose_Click()
If tnama.Text = "" Then
X = MsgBox("YAkinmaukeluar form?", vbYesNo,
"konfirmasi") MsgBox ("DATA BELUNG LENGKAP!Silahkan input
nislalu ENTER")
If X = vbYes Then
tnis.SetFocus
End
Else
End If
If cmapel.Text = "" Then
End Sub
MsgBox ("DATA BELUNG LENGKAP")
cmapel.SetFocus
Private Sub binputlagi_Click()
Else
3. Ahmad Mustaqim | 12100408 3
kursus
If tnominal.Text = "" Then Private Sub Form_Activate()
MsgBox" DATA BELUNG LENGKAP" nonaktif
tnominal.SetFocus LBLTANGGAL.Caption = Format(Date, "yyyy-mm-dd")
Else cmapel.AddItem ("Matematika")
save = "insert into bayar ()values('" &tkode.Text& "','" cmapel.AddItem ("B.Inggris")
&tnis.Text& "','" &LBLTANGGAL.Caption& "')"
cmapel.AddItem ("B.Indonesia")
Set rsbayar = dbado.Execute(save, , adCmdText)
cmapel.AddItem ("Komputer")
sdetail = "insert into detail_bayar ()values('"
&tkode.Text& "','" &cmapel.Text& "','" cmapel.AddItem ("IPA")
&tnominal.Text& "')"
cmapel.AddItem ("IPS")
Set rsdetail = dbado.Execute(sdetail, , adCmdText)
tabel
MsgBox "Data Tersimpan"
End Sub
tabel
nonaktif
Private Sub Form_Load()
End If
koneksi
End If
End Sub
End If
End If
Private Sub tnis_KeyPress(KeyAscii As Integer)
End Sub
If KeyAscii = 13 Then
nis = "select*from siswa where nis='" &tnis.Text& "'"
Private Sub cmapel_Click()
Set rssiswa = dbado.Execute(nis, , adCmdText)
ck = "select * from detail_bayar where kode='"
If rssiswa.EOF Then
&tkode.Text& "' and matpel='" &cmapel.Text& "'"
MsgBox "NIS "&tnis.Text& " tidakditemukan!
Set rsdetail = dbado.Execute(ck, , adCmdText)
Silahkancoba NIS lain!"
If rsdetail.BOFAndrsdetail.EOF Then
tnis = ""
tnominal.SetFocus
tnis.SetFocus
Else
Else
MsgBox " Mapel '" &cmapel.Text& "' SUDAH Di
tnama = rssiswa!nama
bayar!"
cmapel.SetFocus
cmapel.SetFocus
End If
End If End Sub
End If
End Sub