Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Kursus

682 views

Published on

Published in: Education, Technology, Spiritual
  • Be the first to comment

  • Be the first to like this

Kursus

  1. 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 = TrueMODUL binputlagi.Enabled = TruePublic dbado As New ADODB.Connection bcancel.Enabled = TruePublic rssiswa As New ADODB.Recordset bsave.Enabled = TruePublic rsbayar As New ADODB.Recordset End SubPublic 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 Subsource=kursus" Sub kd()dbado.Open Dim code, a, b As StringEnd Sub code = "SELECT * from bayar" Set rsbayar = dbado.Execute(code, , adCmdText)LISTING If rsbayar.BOFAndrsbayar.EOF ThenSub nonaktif() tkode.Text = "B" &Format(Date, "yymm") & "001"tkode.Enabled = False Elsetnis.Enabled = False a=0tnama.Enabled = False rsbayar.MoveFirstcmapel.Enabled = False Do Until rsbayar.EOFtnominal.Enabled = False a=a+1binputlagi.Enabled = False
  2. 2. Ahmad Mustaqim | 12100408 2 kursusrsbayar.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)) tabeltkode.Text = "B" &Format(Date, "yymm") & cmapel.Text = ""Mid$("000", 1, 4 - b) & a tnominal.Text = ""End If cmapel.SetFocusEnd Sub End SubSub tabel()sqlbayar = "select * from detail_bayar" Private Sub bnew_Click()Set rsdetail = dbado.Execute(sqlbayar, , adCmdText) aktifSet Grid1.DataSource = rsdetail bersihEnd Sub kd tnis.SetFocusPrivate Sub bcancel_Click() End Subsqldel = "delete from detail_bayar where kode="&tkode.Text& ""Set rsdetail = dbado.Execute(sqldel, , adCmdText) Private Sub bsave_Click()tabel Dim save As Stringbersih If tnis.Text = "" Thennonaktif MsgBox ("DATA BELUNG LENGKAP!Silahkan input nislalu ENTER")End Sub tnis.SetFocus ElsePrivate Sub bclose_Click() If tnama.Text = "" ThenX = MsgBox("YAkinmaukeluar form?", vbYesNo,"konfirmasi") MsgBox ("DATA BELUNG LENGKAP!Silahkan input nislalu ENTER")If X = vbYes Then tnis.SetFocusEnd ElseEnd If If cmapel.Text = "" ThenEnd Sub MsgBox ("DATA BELUNG LENGKAP") cmapel.SetFocusPrivate Sub binputlagi_Click() Else
  3. 3. Ahmad Mustaqim | 12100408 3 kursusIf tnominal.Text = "" Then Private Sub Form_Activate()MsgBox" DATA BELUNG LENGKAP" nonaktiftnominal.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) tabelMsgBox "Data Tersimpan" End Subtabelnonaktif Private Sub Form_Load()End If koneksiEnd If End SubEnd IfEnd 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 ElseMsgBox " Mapel " &cmapel.Text& " SUDAH Di tnama = rssiswa!namabayar!" cmapel.SetFocuscmapel.SetFocus End If End If End Sub End If End Sub

×