Gambar

Private Sub Command1_Click()
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
txtalas.SetFocus
End Sub
Private Sub Command2_Click()
txtluas.Text = Val(txtalas) * Val(txttinggi) / 2
End Sub
Private Sub Command3_Click()
txtalas.Text = “”
txttinggi.Text = “”
txtluas.Text = “”
txtalas.SetFocus
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub txtalas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttinggi.SetFocus
End If
End Sub

Gambar

Private Sub Command1_Click()
Dim N1, N2, N3, Nr As Long
N1 = Val(txtn1.Text)
N2 = Val(txtn2.Text)
N3 = Val(txtn3.Text)
Nr = Val(txtrt.Text)
Nr = (N1 + N2 + N3) / 3
If Nr < 45 Then
txtrt.Text = Nr
txthm.Text = “E”
ElseIf Nr <= 60 Then
txtrt.Text = Nr
txthm.Text = “D”
ElseIf Nr <= 75 Then
txtrt.Text = Nr
txthm.Text = “C”
ElseIf Nr <= 85 Then
txtrt.Text = Nr
txthm.Text = “B”
ElseIf Nr <= 100 Then
txtrt.Text = Nr
txthm.Text = “A”
End If
End Sub

Private Sub Command2_Click()
Data1.Recordset.AddNew
txtnpm.SetFocus
End Sub

Private Sub Command3_Click()
Data1.Recordset.Update
End Sub

Private Sub Command4_Click()
Data1.Recordset.Delete
End Sub

Private Sub Command5_Click()
End
End Sub

Private Sub Command8_Click()
txtn1.Text = “”
txtn2.Text = “”
txtn3.Text = “”
txtrt.Text = “”
txthm.Text = “”
txtnpm.Text = “”
txtnm.Text = “”
txtps.Text = “”
txtnpm.SetFocus
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 txtnm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtps.SetFocus
End If
End Sub

Private Sub txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnm.SetFocus
End If
End Sub

Private Sub txtps_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn1.SetFocus
End If
End Sub

latihan data base

Gambar

Private Sub Command1_Click()

Data1.Recordset.AddNew

Txtnpm.SetFocus

End Sub

 

Private Sub Command2_Click()

Data1.Recordset.Update

End Sub

 

Private Sub Command3_Click()

Data1.Recordset.Delete

End Suba

 

Private Sub Command4_Click()

 

End

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