Labels

Sabtu, 22 September 2012

Visual Basic Comand "2" > Total harga,Diskon,Total bayar


Private Sub Command1_Click()
Text4.Text = Val(Text2.Text) * Val(Text3.Text)
If Text4.Text >= 500000 Then
        Text5.Text = 0.2 * Val(Text4.Text)
        Text7.Text = "Tas Pinggang"
ElseIf Text4.Text >= 200000 Then
        Text5.Text = 0.15 * Val(Text4.Text)
        Text7.Text = "Payung"
ElseIf Text4.Text >= 100000 Then
        Text5.Text = 0.1 * Val(Text4.Text)
        Text7.Text = "Pena"
Else
        Text5.Text = 0
        Text7.Text = "Tidak Ada"
End If
Text6.Text = Val(Text4.Text) - Val(Text5.Text)
End Sub

Private Sub Command2_Click()
'Membersihkan isi textbox
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text1.SetFocus

End Sub

Private Sub Command3_Click()
ok = MsgBox("Anda Yakin?", vbYesNo + vbExclamation, "Konfirmasi")
If ok = vbYes Then
        Unload Me
End If
End Sub

Private Sub Form_Load()
'Hapus Variabel
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub

Private Sub Text1_Change()

End Sub

Tidak ada komentar:

Posting Komentar