TUGAS 1
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdbatal_Click()
txtn1.SetFocus
txtn1 = “”
txtn2 = “”
txthasil1 = “”
txtn3 = “”
txtn4 = “”
txthasil2 = “”
txtn5 = “”
txtn6 = “”
txthasil3 = “”
txtn7 = “”
txtn8 = “”
txthasil4 = “”
End Sub
Private Sub cmdlagi_Click()
txtn1.SetFocus
txtn1 = “”
txtn2 = “”
txthasil1 = “”
txtn3 = “”
txtn4 = “”
txthasil2 = “”
txtn5 = “”
txtn6 = “”
txthasil3 = “”
txtn7 = “”
txtn8 = “”
txthasil4 = “”
End Sub
Private Sub cmdhitung_Click()
txthasil1 = Val(txtn1) * Val(txtn2)
txthasil2 = Val(txtn3) + Val(txtn4)
txthasil3 = Val(txtn5) – Val(txtn6)
txthasil4 = Val(txtn7) / Val(txtn8)
End Sub
Private Sub txtn1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn2.SetFocus
End If
End Sub
Private Sub txtn2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn3.SetFocus
End If
End Sub
Private Sub txtn3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn4.SetFocus
End If
End Sub
Private Sub txtn4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn5.SetFocus
End If
End Sub
Private Sub txtn5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn6.SetFocus
End If
End Sub
Private Sub txtn6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn7.SetFocus
End If
End Sub
Private Sub txtn7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn8.SetFocus
End If
End Sub
Private Sub txtn8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
End If
End Sub
TUGAS 2
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdbatal_Click()
txtn1.SetFocus
txtn1 = “”
txtn2 = “”
txthasil1 = “”
txtn3 = “”
txtn4 = “”
txthasil2 = “”
txtn5 = “”
txtn6 = “”
txthasil3 = “”
txtn7 = “”
txtn8 = “”
txthasil4 = “”
End Sub
Private Sub cmdlagi_Click()
txtn1.SetFocus
txtn1 = “”
txtn2 = “”
txthasil1 = “”
txtn3 = “”
txtn4 = “”
txthasil2 = “”
txtn5 = “”
txtn6 = “”
txthasil3 = “”
txtn7 = “”
txtn8 = “”
txthasil4 = “”
End Sub
Private Sub cmdhitung_Click()
txthasil1 = Val(txtn1) * Val(txtn2)
txthasil2 = Val(txtn3) + Val(txtn4)
txthasil3 = Val(txtn5) – Val(txtn6)
txthasil4 = Val(txtn7) / Val(txtn8)
End Sub
Private Sub txtn1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn2.SetFocus
End If
End Sub
Private Sub txtn2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn3.SetFocus
txthasil1 = Val(txtn1) * Val(txtn2)
End If
End Sub
Private Sub txtn3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn4.SetFocus
End If
End Sub
Private Sub txtn4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn5.SetFocus
txthasil2 = Val(txtn3) + Val(txtn4)
End If
End Sub
Private Sub txtn5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn6.SetFocus
End If
End Sub
Private Sub txtn6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn7.SetFocus
txthasil3 = Val(txtn5) – Val(txtn6)
End If
End Sub
Private Sub txtn7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn8.SetFocus
End If
End Sub
Private Sub txtn8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txthasil4 = Val(txtn7) / Val(txtn8)
End If
End Sub
TUGAS 3
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdulang_Click()
txtha.SetFocus
txtha = “”
txtdis = “”
txtak = “”
End Sub
Private Sub cmdhitung_Click()
txtdis = Val(txtha) * 0.1
txtak = Val(txtha) – Val(txtdis)
End Sub
TUGAS 4
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdulang_Click()
txtha.SetFocus
txtha = “”
txtdis = “”
txtak = “”
End Sub
Private Sub cmdhitung_Click()
txtdis = Val(txtha) * 0.1
txtak = Val(txtha) – Val(txtdis)
End Sub
Private Sub txtha_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtdis = Val(txtha) * 0.1
txtak = Val(txtha) – Val(txtdis)
End If
End Sub
TUGAS 5
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdulang_Click()
txtgp.SetFocus
txtgp = “”
txttj = “”
txtpt = “”
txtgk = “”
txtpjk = “”
txtgdt = “”
End Sub
Private Sub cmdproses_Click()
txtgk = Val(txtgp) + Val(txttj) – Val(txtpt)
txtpjk = Val(txtgk) * 0.1
txtgdt = Val(txtgk) – Val(txtpjk)
End Sub
Private Sub txtgp_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttj.SetFocus
End If
End Sub
Private Sub txttj_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpt.SetFocus
End If
End Sub
TUGAS 6
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdulang_Click()
txtgp.SetFocus
txtgp = “”
txttj = “”
txtpt = “”
txtgk = “”
txtpjk = “”
txtgdt = “”
End Sub
Private Sub cmdproses_Click()
txtgk = Val(txtgp) + Val(txttj) – Val(txtpt)
txtpjk = Val(txtgk) * 0.1
txtgdt = Val(txtgk) – Val(txtpjk)
End Sub
Private Sub txtgp_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttj.SetFocus
End If
End Sub
Private Sub txttj_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpt.SetFocus
End If
End Sub
Private Sub txtpt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtgk = Val(txtgp) + Val(txttj) – Val(txtpt)
txtpjk = Val(txtgk) * 0.1
txtgdt = Val(txtgk) – Val(txtpjk)
End If
End Sub