TUGAS 1
Private Sub cmdkeluar_Click()
Unload Me
End Sub
Private Sub cmdbatal_Click()
txtnpm.SetFocus
txtnpm = “”
txtnama = “”
txtalamat = “”
End Sub
Private Sub cmdlagi_Click()
txtnpm.SetFocus
txtnpm = “”
txtnama = “”
txtalamat = “”
End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtalamat.SetFocus
End If
End Sub
Private Sub txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub
TUGAS 2
Private Sub cmdkeluar_Click()
Unload Me
End Sub
Private Sub cmdbatal_Click()
txtnpm.SetFocus
txtnpm = “”
txtnama = “”
txtalamat = “”
txtagama = “”
txtjeniskelamin = “”
txtnamaayah = “”
txtnamaibu = “”
txtpekerjaanayah = “”
txtpekerjaanibu = “”
End Sub
Private Sub cmdlagi_Click()
txtnpm.SetFocus
txtnpm = “”
txtnama = “”
txtalamat = “”
txtagama = “”
txtjeniskelamin = “”
txtnamaayah = “”
txtnamaibu = “”
txtpekerjaanayah = “”
txtpekerjaanibu = “”
End Sub
Private Sub txtpekerjaanayah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpekerjaanibu.SetFocus
End If
End Sub
Private Sub txtnamaibu_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpekerjaanayah.SetFocus
End If
End Sub
Private Sub txtnamaayah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnamaibu.SetFocus
End If
End Sub
Private Sub txtjeniskelamin_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnamaayah.SetFocus
End If
End Sub
Private Sub txtagama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtjeniskelamin.SetFocus
End If
End Sub
Private Sub txtalamat_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtagama.SetFocus
End If
End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtalamat.SetFocus
End If
End Sub
Private Sub txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub
TUGAS 3
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdbersih_Click()
txtn1.SetFocus
txtn1 = “”
txtn2 = “”
txthasil = “”
End Sub
Private Sub cmdhitung_Click()
txthasil = Val(txtn1) * Val(txtn2)
End Sub
Private Sub txtn1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn2.SetFocus
End If
End Sub
TUGAS 4
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdbersih_Click()
txtn1.SetFocus
txtn1 = “”
txtn2 = “”
txthasil = “”
End Sub
Private Sub cmdhitung_Click()
txthasil = Val(txtn1) * Val(txtn2)
End Sub
Private Sub txtn2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txthasil = Val(txtn1) * Val(txtn2)
End If
End Sub
Private Sub txtn1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn2.SetFocus
End If
End Sub