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.
Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014
STMIK MIC Cikarang Halaman - 1
Pengetikan Coding...
Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014
STMIK MIC Cikarang Halaman - 2
Tombol : Edit
Pri...
Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014
STMIK MIC Cikarang Halaman - 3
Combo2.AddItem "T...
Upcoming SlideShare
Loading in …5
×

Tugas pemrograman vb6 pengetikan coding pada form front office

1,288 views

Published on

pemrograman vb6

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

  • Be the first to like this

Tugas pemrograman vb6 pengetikan coding pada form front office

  1. 1. Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014 STMIK MIC Cikarang Halaman - 1 Pengetikan Coding pada Form Front Office : Tombol : Tambah Private Sub Command1_Click(Index As Integer) Text1.SetFocus Adodc1.Recordset.AddNew pesan = MsgBox("Anda mau menambah data?", vbInformation, "Informasi") Text1.Text = "" Text2.Text = "" Combo1.Text = "" Combo2.Text = "" Adodc1.Recordset!nip = "" Adodc1.Recordset!nama_peg = "" Adodc1.Recordset!shift = "" Adodc1.Recordset!Status = "" End Sub Tombol : Simpan Private Sub command2_Click(Index As Integer) Adodc1.Recordset.Fields("nip") = Text1.Text Adodc1.Recordset.Fields("nama_peg") = Text2.Text Adodc1.Recordset.Fields("shift") = Combo1.Text Adodc1.Recordset.Fields("status") = Combo2.Text MsgBox "Data sudah disimpan" Text1.Text = "" Text2.Text = "" Combo1.Text = "" Combo2.Text = "" End Sub
  2. 2. Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014 STMIK MIC Cikarang Halaman - 2 Tombol : Edit Private Sub Command3_Click(Index As Integer) Adodc1.Recordset!nip = Text1.Text Adodc1.Recordset!nama_peg = Text2.Text Adodc1.Recordset!shift = Combo1.Text Adodc1.Recordset!Status = Combo2.Text Adodc1.Recordset.Update MsgBox "Data sudah diubah" End Sub Tombol : Hapus Private Sub Command4_Click(Index As Integer) Adodc1.Recordset.Delete Text1.Text = "" Text2.Text = "" Combo1.Text = "" Combo2.Text = "" MsgBox "Data sudah dihapus" Adodc1.Refresh End Sub Tombol : Batal Private Sub Command5_Click(Index As Integer) Text1.Text = "" Text2.Text = "" Combo1.Text = "" Combo2.Text = "" End Sub Tombol : Tutup Private Sub Command6_Click(Index As Integer) Unload Me End Sub Datagrid (klik 2x) : Private Sub DataGrid1_Click() Text1 = Adodc1.Recordset!nip Text2 = Adodc1.Recordset!nama_peg Combo1 = Adodc1.Recordset!shift Combo2 = Adodc1.Recordset!Status End Sub Coding di Form Load untuk menampilkan Combo1 dan Combo2 : Private Sub Form_Load() Combo1.Clear Combo1.AddItem "1" Combo1.AddItem "2" Combo2.Clear
  3. 3. Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014 STMIK MIC Cikarang Halaman - 3 Combo2.AddItem "Tetap" Combo2.AddItem "Tidak Tetap" End Sub Text1.text (Klik 2x) : Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Adodc1.Recordset.MoveFirst Do While Not Adodc1.Recordset.EOF If Adodc1.Recordset!nip = Text1.Text Then MsgBox "Data ditemukan" Text2 = Adodc1.Recordset!nama_peg Combo1 = Adodc1.Recordset!shift Combo2 = Adodc1.Recordset!Status Exit Do Else Adodc1.Recordset.MoveNext End If Loop End If If Not (KeyAscii >= Asc("0") & Chr(13) _ And KeyAscii <= Asc("9") & Chr(13) _ Or KeyAscii = vbKeyBack _ Or KeyAscii = vbKeyDelete _ Or KeyAscii = vbKeySpace) Then Beep KeyAscii = 0 End If End Sub

×