Home » Uncategorized » UTS VISUAL BASIC (PROGRAM DATABASE)

UTS VISUAL BASIC (PROGRAM DATABASE)

kode program :

Private Sub cmdtambah_Click()
txtnoinduk.Text = “”
txtnama.Text = “”
cbojk.Text = “”
txttempatlahir.Text = “”
cboagama.Text = “”
txtalamat.Text = “”
txtnotlp.Text = “”
txtnamawali.Text = “”
txtpekerjaan.Text = “”
txtalamatwali.Text = “”
cbostatus.Text = “”
txttahunmasuk.Text = “”
cbokelas.Text = “”
txtwalikelas.Text = “”
txtnoinduk.SetFocus
End Sub

Private Sub cboagama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttahunmasuk.SetFocus
End If
End Sub

Private Sub cbojk_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttempatlahir.SetFocus
End If
End Sub

Private Sub cbokelas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtwalikelas.SetFocus
End If
End Sub

Private Sub cmdedit_Click()
With Data1.Recordset
.Edit
End With
End Sub

Private Sub cmdsimpan_Click()
With Data1.Recordset
.AddNew
End With
End Sub

Private Sub cmdkeluar_Click()
PSN = MsgBox(“ANDA YAKIN INGIN KELUAR?”, vbCritical + vbYesNo, “PESAN”)
If PSN = vbYes Then
Unload Me
End If
End Sub

Private Sub cmdhapus_Click()
Data1.Recordset.Delete
Data1.Recordset.MoveFirst
End Sub

Private Sub DTPicker1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cboagama.SetFocus
End If
End Sub

Private Sub Form_Load()
cbojk.AddItem “Laki-laki”
cbojk.AddItem “Perempuan”
cboagama.AddItem “Islam”
cboagama.AddItem “Protestan”
cboagama.AddItem “Katholik”
cboagama.AddItem “Hindu”
cboagama.AddItem “Budha”
cboagama.AddItem “Konghucu”
cbostatus.AddItem “Anak Kandung”
cbostatus.AddItem “Anak Angkat”
cbokelas.AddItem “VII”
cbokelas.AddItem “VIII”
cbokelas.AddItem “IX”
End Sub

Private Sub mnexit_Click()
PSN = MsgBox(“ANDA YAKIN INGIN KELUAR?”, vbCritical + vbYesNo, “PESAN”)
If PSN = vbYes Then
Unload Me
End If
End Sub

Private Sub txtalamat_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnotlp.SetFocus
End If
End Sub

Private Sub txtalamatwali_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cbostatus.SetFocus
End If
End Sub

Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cbojk.SetFocus
End If
End Sub

Private Sub txtnamawali_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpekerjaan.SetFocus
End If
End Sub

Private Sub txtnoinduk_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub

Private Sub txtnotlp_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnamawali.SetFocus
End If
End Sub

Private Sub txtpekerjaan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtalamatwali.SetFocus
End If
End Sub

Private Sub txttahunmasuk_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cbokelas.SetFocus
End If
End Sub

Private Sub txttempatlahir_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
DTPicker1.SetFocus
End If
End Sub

Private Sub txtwalikelas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtalamat.SetFocus
End If
End Sub


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

follow on my twitter

Blog Stats

  • 42,490 hits
%d bloggers like this: