Senin, 27 Oktober 2014

VISUAL BASIC DATA BARANG





Private Sub Check1_Click()
If Check1 = 1 Then
    txthorn.Text = 15000
Else
    txthorn.Text = 0
End If
    txtqty1.SetFocus
End Sub

Private Sub Check2_Click()
If Check2 = 1 Then
    txtflesher.Text = 15000
Else
    txtflesher.Text = 0
End If
    txtqty2.SetFocus
End Sub

Private Sub Check3_Click()
If Check3 = 1 Then
    txtspeed.Text = 25000
Else
    txtspeed.Text = 0
End If
    txtqty3.SetFocus
End Sub

Private Sub Check4_Click()
If Check4 = 1 Then
    txtstater.Text = 25000
Else
    txtstater.Text = 0
End If
    txtqty4.SetFocus
End Sub



Private Sub cmdinput_Click()
Combo1.Enabled = True
Check1.Enabled = True
Check2.Enabled = True
Check3.Enabled = True
Check4.Enabled = True
txthorn.Enabled = True
txtflesher.Enabled = True
txtspeed.Enabled = True
txtstater.Enabled = True
txtqty1.Enabled = True
txtqty2.Enabled = True
txtqty3.Enabled = True
txtqty4.Enabled = True
Option1.Enabled = True
Option3.Enabled = True
Option2.Enabled = True
txtnm.Text = ""
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
txtjumlah1 = ""
txtjumlah2 = ""
txthorn.Text = ""
txtflesher.Text = ""
txtspeed.Text = ""
txtstater.Text = ""
txtqty1.Text = ""
txtqty2.Text = ""
txtqty3.Text = ""
txtqty4.Text = ""
txtbiaya.Text = ""
Option1.Value = 0
Option3.Value = 0
Option2.Value = 0
txtbiayaadm.Text = ""
txttobay.Text = ""
cmdinput.SetFocus
End Sub 


Private Sub cmdjml1_Click()
txtjumlah1.Text = (Val(txthorn.Text) * Val(txtqty1)) + (Val(txtflesher.Text) * Val(txtqty2.Text))
End Sub


 Private Sub cmdjml2_Click()
txtjumlah2.Text = (Val(txtspeed.Text) * Val(txtqty3)) + (Val(txtstater.Text) * Val(txtqty4.Text))
End Sub


Private Sub cmdkeluar_Click()
r = MsgBox("Anda yakin ingin keluar", vbInformation + vbYesNo, "Informasi")
If r = v

bYes Then
End
End If
End Sub


 Private Sub Combo1_Click()
If Combo1.Text = "1201" Then
txtnm.Text = "Ali"
ElseIf Combo1.Text = "1202" Then
txtnm.Text = "Malik"
Else
txtnm.Text = "Hadi"
End If
End Sub


 Private Sub cmdhitung_Click()
txtbiaya.Text = Val(txtjumlah1.Text) + Val(txtjumlah2.Text)
End Sub


 Private Sub Form_Load()
Combo1.Enabled = False
txtnm.Enabled = False
Check1.Enabled = False
Check2.Enabled = False
Check3.Enabled = False
Check4.Enabled = False
txthorn.Enabled = False
txtflesher.Enabled = False
txtspeed.Enabled = False
txtstater.Enabled = False
txtqty1.Enabled = False
txtqty2.Enabled = False
txtqty3.Enabled = False
txtqty4.Enabled = False
txtjumlah1.Enabled = False
txtjumlah2.Enabled = False
txtbiaya.Enabled = False
Option1.Enabled = False
Option3.Enabled = False
Option2.Enabled = False
txtbiayaadm.Enabled = False
txttobay.Enabled = False
End Sub


Private Sub Option1_Click()
txtbiayaadm.Text = 10000
txttobay = Val(txtbiaya) + Val(txtbiayaadm)
End Sub

Private Sub Option2_Click()
txtbiayaadm.Text = 8500
txttobay = Val(txtbiaya) + Val(txtbiayaadm)
End Sub

Private Sub Option3_Click()
txtbiayaadm.Text = 5000
txttobay = Val(txtbiaya) + Val(txtbiayaadm)
End Sub



Private Sub Timer1_Timer()
tanggal.Text = Format(Date, "dd-mm-yyyy")
jam.Text = Format(Time, "h:m:s")
End Sub