TUGAS VB

Private Sub CMDPROSES_Click()
Dim A, B, C, D, E, F As Double
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 CMDKELUAR_Click()
Unload Me
End Sub

Private Sub CMDULANG_Click()
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
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
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
CMDPROSES.SetFocus
End If
End Sub

Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As String

Select Case Cbonpm.Text
Case “11100155”
nama = “WINDI ASTARI”
jurusan = “Sistem Informasi”
Case “11100100”
nama = “TITI SOLIKHAH”
jurusan = “Manajemen Informatika”
Case “11100088”
nama = “DINAR KUSUMAWATI”
jurusan = “Tehnik Informatika”
End Select
Txtnama.Text = nama
Txtjurusan.Text = jurusan
Txtquis.SetFocus
End Sub
Private Sub Cmdbatal_Click()
Cbonpm.SetFocus
Cbonpm.Text = “”
Txtnama.Text = “”
Txtjurusan.Text = “”
Txtquis.Text = “”
Txttugas.Text = “”
Txtuts.Text = “”
txtuas.Text = “”
Txtna.Text = “”
Txthm.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub
Private Sub Cmdproses_Click()
Dim NA As Integer
Dim HM As String
QUIS = Val(Txtquis.Text)
TUGAS = Val(Txttugas.Text)
UTS = Val(Txtuts.Text)
UAS = Val(txtuas.Text)
NA = (QUIS + TUGAS + UTS + UAS) / 4
Txtna.Text = NA

Select Case Txtna.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
Txthm.Text = HM
End Sub
Private Sub Form_Load()
Cbonpm.AddItem “11100155”
Cbonpm.AddItem “11100100”
Cbonpm.AddItem “11100088”
End Sub

Private Sub txtquis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttugas.SetFocus
End If
End Sub

Private Sub txttugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtuts.SetFocus
End If
End Sub
Private Sub txtuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtuas.SetFocus
End If
End Sub


Private Sub Command1_Click()
Dim A, B As Double
Text2.Text = Val(Text1.Text) * 0.1
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
End Sub

Private Sub Command3_Click()
End
End Sub

 

 

Private Sub Command1_Click()
Dim K, S As String
Dim C As Long
K = Left(Text2.Text, 1)
If K = “E” Or K = “e” Then
Text3.Text = “EKSEKUTIF”
S = Mid(Text2.Text, 6, 2)
If S = “01” Then
text5.Text = “STRATA SATU”
text8.Text = “200000”
text9.Text = “1900000”
text10.Text = “1250000”
text11.Text = “600000”
ElseIf S = “02” Then
text5.Text = “DIPLOMA TIGA”
text8.Text = “150000”
text9.Text = “1650000”
text10.Text = “1250000”
text11.Text = “600000”
ElseIf S = “03” Then
text5.Text = “DIPLOMA SATU”
text8.Text = “150000”
text9.Text = “1350000”
text10.Text = “1250000”
text11.Text = “600000”
End If
End If
C = Val(text8.Text) + Val(text9.Text) + Val(text10.Text) + Val(text11.Text)
text12.Text = C
If K = “R” Or K = “r” Then
Text3.Text = “REGULER”
S = Mid(Text2.Text, 6, 2)
If S = “01” Then
text5.Text = “STRATA SATU”
text8.Text = “200000”
text9.Text = “1500000”
text10.Text = “1000000”
text11.Text = “600000”
ElseIf S = “02” Then
text5.Text = “DIPLOMA TIGA”
text8.Text = “150000”
text9.Text = “1250000”
text10.Text = “1000000”
text11.Text = “600000”
ElseIf S = “03” Then
text5.Text = “DIPLOMA SATU”
text8.Text = “150000”
text9.Text = “1250000”
text10.Text = “1000000”
text11.Text = “600000”
End If
End If
C = Val(text8.Text) + Val(text9.Text) + Val(text10.Text) + Val(text11.Text)
text12.Text = C
text6.Text = “20” & Mid(Text2.Text, 3, 2)
S = Mid(Text2.Text, 5, 1)
If S = “1” Then
Text4.Text = “SISTEM INFORMASI”
ElseIf S = “2” Then
Text4.Text = “MANAJEMEN INFORMATIKA”
ElseIf S = “3” Then
Text4.Text = “MANAJEMEN & KOM.AKUTYANSI”
End If
text7.Text = Right(Text2.Text, 3)

text8.Text = FormatNumber(text8, 2)
text9.Text = FormatNumber(text9, 2)
text10.Text = FormatNumber(text10, 2)
text11.Text = FormatNumber(text11, 2)
text12.Text = FormatNumber(text12, 2)
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
text5.Text = “”
text6.Text = “”
text7.Text = “”
text8.Text = “”
text9.Text = “”
text10.Text = “”
text11.Text = “”
text12.Text = “”
End Sub

Private Sub Command4_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
text5.Text = “”
text6.Text = “”
text7.Text = “”
text8.Text = “”
text9.Text = “”
text10.Text = “”
text11.Text = “”
text12.Text = “”
End Sub

Private Sub Form_Activate()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
text5.Text = “”
text6.Text = “”
text7.Text = “”
text8.Text = “”
text9.Text = “”
text10.Text = “”
text11.Text = “”
text12.Text = “”
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

List1.AddItem c
Loop
End Sub


KODE PROGRAM
Private Sub Form_Activate()
Dim A As Integer
A = 0
Do While A< 20
A = A + 2
List1.AddItem A
Loop
End Sub

KODE PROGRAM
Private Sub Form_Activate()
Dim B As Integer
For B = 5 To 499 Step 27
List1.AddItem B + 3
Next B
End Sub

Iklan

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 )

Foto Google+

You are commenting using your Google+ 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 )

Connecting to %s