Dim Kubik, Sisa, A, B, C As Currency
Dim TotalBayar As Currency
Private Sub Command1_Click()
If TxtPemakaian.Text = "" Then
MsgBox "Belum Di Isi", 0, "Informasi"
Text1.SetFocus
Else
Kubik = TxtPemakaian.Text
If Not Kubik < 5 Then
Sisa = Kubik - 5
End If
If Sisa < 10 Then
B = Sisa
Sisa = 0
Else
Sisa = Sisa - 10
B = 10
End If
If Sisa < 30 Then
C = Sisa
Sisa = 0
Else
Sisa = Sisa - 30
C = 30
End If
TotalBayar = (B * 2000) + (C * 5000) + (Sisa * 6500) + 20000
TxtTotal.Text = TotalBayar
Text3.Text = B * 2000
Text4.Text = C * 5000
Text5.Text = Sisa * 6500
Text6.Text = 20000
Text7.Text = B
Text8.Text = C
Text9.Text = Sisa
End If
If Not TotalBayar = 0 Then
Command4.Enabled = True
End If
End Sub
Private Sub Command2_Click()
If MsgBox("Anda Yakin", vbYesNo, "Keluar") = vbYes Then
End
End If
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
TxtPemakaian.Text = ""
TxtTotal.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Command4.Enabled = False
End Sub
Private Sub Command4_Click()
MsgBox "No Pelanggan : " + Text1.Text + Chr(13) + _
"Nama Pelanggan : " + Text2.Text + Chr(13) + _
"Jumlah Pemakaian : " + TxtPemakaian.Text + Chr(13) + _
"Total Bayar : " + TxtTotal.Text + Chr(13), 0, "Informasi"
End Sub
Private Sub Form_Load()
TxtTotal.Enabled = False
Command4.Enabled = False
End Sub
0 komentar:
Posting Komentar