PRAKTIKUM VB 1

Private Sub APLIKASIPERHITUNGANGAJI_Click()

UAPLIKASIPERHITUNGANGAJI.Show

End Sub

 

Private Sub HURUFMUTU_Click()

UHURUFMUTU.Show

End Sub

 

Private Sub KRETAAPI_Click()

KERETAAPI.Show

End Sub

Private Sub PTPULANGPETANG_Click()

UPTPULANGPETANG.Show

End Sub

 

 

 

 

Private Sub Cmdkeluar_Click()

 

Unload Me

 

End Sub

 

 

 

Private Sub Cmdlagi_Click()

 

Txtkt.SetFocus

 

Txtkt.Text = “”

 

Txtht.Text = “”

 

Txtjk.Text = “”

 

Txtjb.Text = “”

 

Txtjt.Text = “”

 

Txttotalp.Text = “”

 

End Sub

 

 

 

Private Sub Cmdproses_Click()

 

Dim KT As String

 

Dim T As Long

 

KT = Left(Txtkt.Text, 3)

 

If KT = “BIM” Then

 

Txtht.Text = “50000”

 

Txtjk.Text = “BIMA”

 

Txtjb.Text = “16.00”

 

ElseIf KT = “EKO” Then

 

Txtht.Text = “35000”

 

Txtjk.Text = “EKONOMI”

 

Txtjb.Text = “19.00”

 

ElseIf KT = “SEN” Then

 

Txtht.Text = “15000”

 

Txtjk.Text = “SENJA”

 

Txtjb.Text = “20.00”

 

ElseIf KT = “MUT” Then

 

Txtht.Text = “23000”

 

Txtjk.Text = “MUTIARA”

 

Txtjb.Text = “17.00”

 

End If

 

Txtjt.SetFocus

 

End Sub

 

Private Sub Txtjt_KeyPress(KeyAscii As Integer)

 

If KeyAscii = 13 Then

 

Txttotalp.Text = Val(Txtht.Text) * Val(Txtjt.Text)

 

End If

End Sub

Private Sub Command1_Click()

 

Dim NQ, NT, UTS, UAS, NA As Integer

 

Dim HM As String

 

NQ = Val(Text4.Text)

 

NT = Val(Text5.Text)

 

UTS = Val(Text6.Text)

 

UAS = Val(Text7.Text)

 

NA = (NQ + NT + UTS + UAS) / 4

 

If NA < 51 Then

 

HM = “E”

 

ElseIf NA < 61 Then

 

HM = “D”

 

ElseIf NA < 71 Then

 

HM = “C”

 

ElseIf NA < 81 Then

 

HM = “B”

 

Else

 

HM = “A”

 

End If

 

Text8.Text = NA

 

Text9.Text = HM

 

End Sub

 

 

 

Private Sub Command2_Click()

 

Text1.Text = “”

 

Text2.Text = “”

 

Text3.Text = “”

 

Text4.Text = “”

 

Text5.Text = “”

 

Text6.Text = “”

 

Text7.Text = “”

 

Text8.Text = “”

 

Text9.Text = “”

 

Combo1.Text = “”

 

Combo1.SetFocus

 

End Sub

 

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Form_Load()

 

Combo1.AddItem “11100047”

 

Combo1.AddItem “11100046”

 

Combo1.AddItem “11100049”

 

 

 

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

 

 

Private Sub Command1_Click()

Dim KO As String

Dim TU, GP As Long

Dim TG As Currency

Text4.Text = Mid(Text11, 2, 4)

KO = Left(Text11, 1)

If KO = “A” Then

Text1.Text = “A”

Text5.Text = “MANAGER”

Text7.Text = “2500000”

Text8.Text = “625000”

ElseIf KO = “B” Then

Text1.Text = “B”

Text5.Text = “KA SEKSI”

Text7.Text = “1500000”

Text8.Text = “375000”

ElseIf KO = “C” Then

Text1.Text = “C”

Text5.Text = “STAFF”

Text7.Text = “1000000”

Text8.Text = “250000”

End If

TU = Val(Text8.Text)

GP = Val(Text7.Text)

TG = GP + TU

Text9.Text = TG

KO = Mid(Text11, 6, 3)

If KO = “KEU” Then

Text6.Text = “ACCOUNTING”

ElseIf KO = “ADM” Then

Text6.Text = “ADMINISTRATION”

ElseIf KO = “SDM” Then

Text6.Text = “GENERAL AFFAIR”

ElseIf KO = “EDP” Then

Text6.Text = “IT UNIT”

ElseIf KO = “SPM” Then

Text6.Text = “SECURITY”

End If

KO = Right(Text11, 1)

If KO = “M” Then

Text2.Text = “M”

Text3.Text = “MENIKAH”

ElseIf KO = “S” Then

Text2.Text = “S”

Text3.Text = “SINGGEL”

ElseIf KO = “J” Then

Text2.Text = “J”

Text3.Text = “JANDA”

ElseIf KO = “D” Then

Text2.Text = “D”

Text3.Text = “DUDA”

End If

End Sub

 

Private Sub Command2_Click()

Text10.Text = “”

Text11.Text = “”

Text10.SetFocus

End Sub

 

Private Sub Command3_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text7.Text = “”

Text8.Text = “”

Text9.Text = “”

Text10.Text = “”

Text11.Text = “”

Text10.SetFocus

End Sub

 

Private Sub Command4_Click()

Unload Me

End Sub

 

 

 

 

 

 

 

 

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s