Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Dimi As Integer
Dimtotalx As Integer
Private SubcbThn_Click()
Dimtgl AsInteger
Dimbln AsInteger
Dimthn As Integer
tgl = cbTgl.Text
bln= cbBulan.Text
thn = cbThn.Text
If Combo2 = "Paramex"AndcbThn>= 2015 AndcbBulan>=
12 Andtgl >= 14 Then
MsgBox "Maaf Obat sudahkadaluarsa",vbInformation
ElseIf Combo2= "OBH" AndcbThn >= 2015 AndcbBulan>=
12 Andtgl >= 15 Then
MsgBox "Maaf Obat sudahkadaluarsa",vbInformation
ElseIf Combo2= "Panadol"AndcbThn>= 2015 And
cbBulan>= 12 Andtgl >= 18 Then
MsgBox "Maaf Obat sudahkadaluarsa",vbInformation
ElseIf Combo2= "Komix"AndcbThn>= 2015 AndcbBulan
>= 12 Andtgl >= 14 Then
MsgBox "Maaf Obat sudahkadaluarsa",vbInformation
ElseIf Combo2= "Amosilin"AndcbThn>= 2015 And
cbBulan>= 12 Andtgl >= 17 Then
MsgBox "Maaf Obat sudahkadaluarsa",vbInformation
End If
End Sub
Private SubCombo2_Click()
If Combo2 = "Paramex"Then
Text3.Text= "Pcs"
Text4.Text= 4000
Text1.Text= Format(Date,"13/12/2015")
ElseIf Combo2= "OBH" Then
Text3.Text= "Botol"
Text4.Text= 8000
Text1.Text= Format(Date,"14/12/2015")
ElseIf Combo2= "Panadol"Then
Text3.Text= "Tablet"
Text4.Text= 500
Text1.Text= Format(Date,"17/12/2015")
ElseIf Combo2= "Komix"Then
Text3.Text= "Pcs"
Text4.Text= 1500
Text1.Text= Format(Date,"13/12/2015")
ElseIf Combo2= "Amosilin"Then
Text3.Text= "Tablet"
Text4.Text= 3000
Text1.Text= Format(Date,"16/12/2015")
End If
End Sub
Private SubForm_Load()
Combo2.AddItem"Paramex"
Combo2.AddItem"OBH"
Combo2.AddItem"Panadol"
Combo2.AddItem"Komix"
Combo2.AddItem"Amosilin"
On Error Resume Next
For i = 1 To 12
cbBulan.AddItem(i)
Nexti
On Error Resume Next
For i = 1 To 31
cbTgl.AddItem(i)
Nexti
On Error Resume Next
For i = 2010 To 2020
cbThn.AddItem(i)
Nexti
End Sub
Private SubText5_Change()
Dimdis AsInteger
DimjlhAs Integer
jlh= Text2.Text
dis= Text5.Text
totalx = jlh* Val(Text4.Text)
Text6.Text= totalx - dis
End Sub
Private SubText7_Change()
Text8.Text= Val(Text7.Text) - Val(Text6.Text)
End Sub

More Related Content

Dim i as integer

  • 1. Dimi As Integer Dimtotalx As Integer Private SubcbThn_Click() Dimtgl AsInteger Dimbln AsInteger Dimthn As Integer tgl = cbTgl.Text bln= cbBulan.Text thn = cbThn.Text If Combo2 = "Paramex"AndcbThn>= 2015 AndcbBulan>= 12 Andtgl >= 14 Then MsgBox "Maaf Obat sudahkadaluarsa",vbInformation ElseIf Combo2= "OBH" AndcbThn >= 2015 AndcbBulan>= 12 Andtgl >= 15 Then MsgBox "Maaf Obat sudahkadaluarsa",vbInformation ElseIf Combo2= "Panadol"AndcbThn>= 2015 And cbBulan>= 12 Andtgl >= 18 Then MsgBox "Maaf Obat sudahkadaluarsa",vbInformation ElseIf Combo2= "Komix"AndcbThn>= 2015 AndcbBulan >= 12 Andtgl >= 14 Then MsgBox "Maaf Obat sudahkadaluarsa",vbInformation ElseIf Combo2= "Amosilin"AndcbThn>= 2015 And cbBulan>= 12 Andtgl >= 17 Then MsgBox "Maaf Obat sudahkadaluarsa",vbInformation End If End Sub Private SubCombo2_Click() If Combo2 = "Paramex"Then Text3.Text= "Pcs" Text4.Text= 4000 Text1.Text= Format(Date,"13/12/2015") ElseIf Combo2= "OBH" Then Text3.Text= "Botol" Text4.Text= 8000 Text1.Text= Format(Date,"14/12/2015") ElseIf Combo2= "Panadol"Then Text3.Text= "Tablet" Text4.Text= 500 Text1.Text= Format(Date,"17/12/2015") ElseIf Combo2= "Komix"Then Text3.Text= "Pcs" Text4.Text= 1500 Text1.Text= Format(Date,"13/12/2015") ElseIf Combo2= "Amosilin"Then Text3.Text= "Tablet" Text4.Text= 3000 Text1.Text= Format(Date,"16/12/2015") End If End Sub Private SubForm_Load() Combo2.AddItem"Paramex" Combo2.AddItem"OBH" Combo2.AddItem"Panadol" Combo2.AddItem"Komix" Combo2.AddItem"Amosilin" On Error Resume Next For i = 1 To 12 cbBulan.AddItem(i) Nexti On Error Resume Next For i = 1 To 31 cbTgl.AddItem(i) Nexti On Error Resume Next For i = 2010 To 2020 cbThn.AddItem(i) Nexti End Sub Private SubText5_Change() Dimdis AsInteger DimjlhAs Integer jlh= Text2.Text dis= Text5.Text totalx = jlh* Val(Text4.Text) Text6.Text= totalx - dis End Sub Private SubText7_Change() Text8.Text= Val(Text7.Text) - Val(Text6.Text) End Sub