Liat dulu nihh tampilannya,,,
nihhh baru koding nya,,,
Private Sub Form_Load()
xNO.Enabled = False
xMETERLALU.Enabled = False
xMETERSEKARANG.Enabled = False
xPAKAI.Enabled = False
xBAYAR.Enabled = False
End Sub
Private Sub INPUT_Click()
xNO.Enabled = True
xMETERLALU.Enabled = True
xMETERSEKARANG.Enabled = True
xPAKAI.Enabled = True
xBAYAR.Enabled = True
xNO.Text = ""
xMETERLALU.Text = ""
xMETERSEKARANG.Text = ""
xNO.SetFocus
xNO.BackColor = vbWhite
xMETERLALU.BackColor = vbWhite
xMETERSEKARANG.BackColor = vbWhite
xPAKAI.BackColor = vbWhite
xBAYAR.BackColor = vbWhite
End Sub
Private Sub xMETERSEKARANG_LostFocus()
xPAKAI.Text = Val(xMETERSEKARANG.Text) - Val(xMETERLALU.Text)
End Sub
Private Sub xPAKAI_LostFocus()
If Val(xPAKAI.Text) <= 10 Then
tarif1 = 5000 * Val(xPAKAI.Text)
tarif2 = 0
tarif3 = 0
End If
If (Val(xPAKAI.Text) > 10) And (Val(xPAKAI.Text) <= 20) Then
tarif1 = 5000 * Val(10)
tarif2 = 10000 * (Val(xPAKAI.Text) - 10)
tarif3 = 0
End If
If Val(xPAKAI.Text) > 20 Then
tarif1 = 5000 * Val(10)
tarif2 = 10000 * Val(10)
tarif3 = 15000 * (Val(xPAKAI.Text) - 20)
End If
xBAYAR.Text = tarif1 + tarif2 + tarif3
End Sub
Private Sub KELUAR_Click()
End
End Sub
0 komentar:
Posting Komentar