T5

PT

Private Sub Txtmnk_keypress(keyascii As Integer)

If keyascii = 13 Then

Txtmn.SetFocus

End If

End Sub

Private Sub CmdK_Click()

End

End Sub

Private Sub CmdL_Click()

Txtmnk.SetFocus

Txtmnk = “”

Txtmn = “”

Txtgol = “”

Txtks = “”

Txts = “”

Txtt = “”

Txtj = “”

Txtb = “”

Txtgp = “”

Txttj = “”

Txttg = “”

End Sub

Private Sub CmdB_Click()

Txtmnk.SetFocus

Txtmnk = “”

Txtmn = “”

Txtgol = “”

Txtks = “”

Txts = “”

Txtt = “”

Txtj = “”

Txtb = “”

Txtgp = “”

Txttj = “”

Txttg = “”

End Sub

Private Sub CmdP_Click()

Txtt = Left(Txtmn.Text, 4)

G = Mid(Txtmn.Text, 5, 1)

If G = “A” Then

Txtgol = “A”

Txtj = “Manager”

Txtgp = “4000000”

Txttj = “1025000”

ElseIf G = “B” Then

Txtgol = “B”

Txtj = “Ka.Seksi”

Txtgp = “3500000”

Txttj = “975000”

ElseIf G = “C” Then

Txtgol = “C”

Txtj = “Staff”

Txtgp = “3000000”

Txttj = “925000”

End If

S = Mid(Txtmn.Text, 7, 1)

If S = “S” Then

Txtks = “S”

Txts = “Single”

ElseIf S = “M” Then

Txtks = “M”

Txts = “Menikah”

ElseIf S = “J” Then

Txtks = “J”

Txts = “Janda”

ElseIf S = “D” Then

Txtks = “D”

Txts = “Duda”

End If

B = Right(Txtmn.Text, 3)

If B = “KEU” Then

Txtb = “Accounting”

ElseIf B = “ADM” Then

Txtb = “Administrasi”

ElseIf B = “SDM” Then

Txtb = “General Affair”

ElseIf B = “EDP” Then

Txtb = “IT Unit”

ElseIf B = “SPM” Then

Txtb = “Security”

End If

Txttg = Val(Txtgp.Text) + Val(Txttj.Text)

End Sub

T4

penjualan lptop

Private Sub Cbokl_Click()

kode = Mid(Cbokl.Text, 7, 5)

If kode = “MC965” Then

Txtmt = “Apple Macbook Air” & “Mid(Cbokl.Text,7,5)”

Txths = “12800000”

ElseIf kode = “MC966” Then

Txtmt = “Apple Macbook Air” & “Mid(Cbokl.Text,7,5)”

Txths = “15800000”

ElseIf kode = “MC968” Then

Txtmt = “Apple Macbook Air” & “Mid(Cbokl.Text,7,5)”

Txths = “9900000”

ElseIf kode = “MC969” Then

Txtmt = “Apple Macbook Air” & “Mid(Cbokl.Text,7,5)”

Txths = “11900000”

ElseIf kode = “MC700” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “10800000”

ElseIf kode = “MC721” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “15900000”

ElseIf kode = “MC723” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “19300000”

ElseIf kode = “MC724” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “13700000”

ElseIf kode = “MC311” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “24200000”

ElseIf kode = “MC313” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “11900000”

ElseIf kode = “MC314” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “14700000”

ElseIf kode = “MC318” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “17600000”

ElseIf kode = “MC322” Then

Txtmt = “Apple Macbook Pro” & “Mid(Cbokl.Text,7,5)”

Txths = “21300000”

End If

Txtjj.SetFocus

End Sub

 

Private Sub Cmdhl_Click()

Cbokl.SetFocus

Cbokl = “”

Txtmt = “”

Txths = “”

Txtjj = “”

Txthp = “”

Txtdis = “”

Txttb = “”

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdproses_Click()

Txthp = Val(Txths.Text) * Val(Txtjj.Text)

If Txthp >= 14000000 Then

Txtdis = Val(Txthp.Text) * 0.15

ElseIf Txthp >= 1350000 Then

Txtdis = Val(Txthp.Text) * 0.1

ElseIf Txthp >= 13000000 Then

Txtdis = Val(Txthp.Text) * 0.05

ElseIf Txthp >= 12500000 Then

Txtdis = Val(Txthp.Text) * 0.02

End If

Txttb = Val(Txthp.Text) – Val(Txtdis.Text)

End Sub

 

Private Sub Form_Activate()

Cbokl.AddItem “Apple MC965 MacBook Air”

Cbokl.AddItem “Apple MC966 MacBook Air”

Cbokl.AddItem “Apple MC968 MacBook Air”

Cbokl.AddItem “Apple MC969 MacBook Air”

Cbokl.AddItem “Apple MC700 MacBook Pro”

Cbokl.AddItem “Apple MC721 MacBook Pro”

Cbokl.AddItem “Apple MC723 MacBook Pro”

Cbokl.AddItem “Apple MC724 MacBook Pro”

Cbokl.AddItem “Apple MC311 MacBook Pro”

Cbokl.AddItem “Apple MC313 MacBook Pro”

Cbokl.AddItem “Apple MC314 MacBook Pro”

Cbokl.AddItem “Apple MC318 MacBook Pro”

Cbokl.AddItem “Apple MC322 MacBook Pro”

Cbokl.AddItem “Apple MC965 MacBook Air”

Cbokl.AddItem “Apple MC966 MacBook Air”

End Sub

T3

strata

Private Sub Command3_Click()

Text1.SetFocus

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

End Sub

 

Private Sub Command2_Click()

Text1.SetFocus

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

End Sub

 

Private Sub Command4_Click()

Unload Me

End Sub

 

Private Sub Command1_Click()

Dim S As String

Text5.Text = “20” & Left(Text2.Text, 2)

S = Mid(Text2.Text, 3, 1)

If S = “1” Then

Text3.Text = “Sistem Informasi”

ElseIf S = “2” Then

Text3.Text = “Manajemen Informatika”

ElseIf S = “3” Then

Text3.Text = “Tehnik Informatika”

ElseIf S = “4” Then

Text3.Text = “Manajemen & Komp. Akuntansi”

End If

S = Mid(Text2.Text, 4, 2)

If S = “01” Then

Text4.Text = “Strata Satu”

ElseIf S = “02” Then

Text4.Text = “Diploma Tiga”

ElseIf S = “03” Then

Text4.Text = “Diploma Empat”

ElseIf S = “04” Then

Text4.Text = “Diploma Dua”

End If

Text6.Text = Right(Text2.Text, 3)

End Sub

 

Private Sub Form_Activate()

Text1.SetFocus

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

End Sub

 

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

T2

1

Private Sub Combo1_Click()

Dim gapok, pajak, tunjangan, total As Variant

Select Case Combo1.Text

Case “I”

gapok = 1500000

tunjangan = 150000

Case “II”

gapok = 2000000

tunjangan = 200000

Case “III”

gapok = 2500000

tunjangan = 250000

Case “IV”

gapok = 3000000

tunjangan = 300000

Case Else

gapok = 0

tunjangan = 0

End Select

total = gapek + tunjangan

pajak = total * 0.1

Text3.Text = gapok

Text4.Text = tunjangan

Text5.Text = pajak

Text6.Text = total – pajak

End Sub

Private Sub Command1_Click()

kosong

End Sub

Private Sub Command2_Click()

kosong

End Sub

Private Sub Command3_Click()

Unload Me

End Sub

Private Sub Form_Load()

Combo1.AddItem “I”

Combo1.AddItem “II”

Combo1.AddItem “III”

Combo1.AddItem “IV”

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

T1

 

 

tugas nama

Private Sub Check1_Click()

Label2.FontBold = Check1.Value

End Sub

 

Private Sub Check2_Click()

Label2.FontItalic = Check2.Value

End Sub

 

Private Sub Command1_Click()

Label2.Caption = Text1.Text

End Sub

 

Private Sub Command2_Click()

Unload Me

End Sub

 

Private Sub Option1_Click()

Label2.ForeColor = vbBlue

End Sub

 

Private Sub Option2_Click()

Label2.ForeColor = vbRed

End Sub

Tugas 6

 

 

Private Sub Combo1_Click()

Dim NAMA, JURUSAN As String

Select Case Combo1.Text

Case “12100051”

NAMA = “ERNITA SARI”

JURUSAN = “SISTEM INFORMASI”

Case “12100067”

NAMA = “TRI INDAH SARI”

JURUSAN = “SISTEM INFORMASI”

Case “12100042”

NAMA = “ISMIYATI”

JURUSAN = “SISTEM INFORMASI”

End Select

Text1.Text = NAMA

Text2.Text = JURUSAN

Text3.SetFocus

 

End Sub

 

Private Sub Command1_Click()

Dim Quis, Tgs, UTS, UAS, NA As Integer

Dim Hm As String

Quis = Val(Text3.Text)

Tgs = Val(Text4.Text)

UTS = Val(Text5.Text)

UAS = Val(Text6.Text)

NA = (Quis + Tgs + UTS + UAS) / 4

Text7.Text = NA

Select Case Text7.Text

Case Is > 80

Hm = “A”

Case Is > 70

Hm = “B”

Case Is > 60

Hm = “C”

Case Is > 50

Hm = “D”

Case Is < 50

Hm = “E”

End Select

Text8.Text = Hm

End Sub

 

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

Text2 = “”

Text3 = “”

Text4 = “”

Text5 = “”

Text6 = “”

Text7 = “”

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Form_Activate()

Text1.SetFocus

Text1 = “”

Text2 = “”

Text3 = “”

Text4 = “”

Text5 = “”

Text6 = “”

Text7 = “”

End Sub

 

Private Sub Form_Load()

Combo1.AddItem “12100051”

Combo1.AddItem “12100067”

Combo1.AddItem “12100042”

End Sub

 

Private Sub Text3_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text4.SetFocus

End If

End Sub

 

Private Sub Text4_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text5.SetFocus

End If

End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text6.SetFocus

End If

End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text7.SetFocus

End If

End Sub

Tugas 5

 

Private Sub Check1_Click()

Label1.FontBold = Check1.Value

End Sub

 

Private Sub Check2_Click()

Label1.FontItalic = Check2.Value

End Sub

 

Private Sub Check3_Click()

Label1.FontUnderline = Check3.Value

End Sub

 

Private Sub Check4_Click()

Label1.FontStrikethru = Check4.Value

End Sub

Private Sub Command1_Click()

Unload Me

End Sub

 

Private Sub Option1_Click()

Label1.ForeColor = vbRed

End Sub

 

Private Sub Option2_Click()

Label1.ForeColor = vbGreen

End Sub

 

Private Sub Option3_Click()

Label1.ForeColor = vbBlue

End Sub

 

Private Sub Option4_Click()

Label1.ForeColor = vbYellow

End Sub

Tugas 4

 

Private Sub Command1_Click()

Text4.Text = Val(Text1.Text) + Val(Text2.Text) – Val(Text3.Text)

Text5.Text = Val(Text4.Text) * 0.1

Text6.Text = Val(Text4.Text) – Val(Text5.Text)

End Sub

 

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

Text2 = “”

Text3 = “”

Text4 = “”

Text5 = “”

Text6 = “”

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

 

Private Sub Text2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text3.SetFocus

End If

End Sub

Tugas 3

Private Sub Command1_Click()

Text2.Text = Val(Text1.Text) * 0.1

Text3.Text = Val(Text1.Text) – Val(Text2.Text)

End Sub

 

Private Sub Command2_Click()

Text1.SetFocus

Text1 = “”

Text2 = “”

Text3 = “”

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

Tugas 2

 

Private Sub Command1_Click()

Text3.Text = Val(Text1.Text) + Val(Text2.Text)

End Sub

 

Private Sub Command2_Click()

Text3.Text = Val(Text1.Text) * Val(Text2.Text)

End Sub

 

Private Sub Command3_Click()

Text3.Text = Val(Text1.Text) – Val(Text2.Text)

End Sub

 

Private Sub Command4_Click()

Text3.Text = Val(Text1.Text) / Val(Text2.Text)

End Sub

 

Private Sub Command5_Click()

Unload Me

End Sub

 

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub