nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus....

33
1.TUGAS 1 Private Sub Command1_Click() Text1.SetFocus Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub Private Sub Command2_Click() Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM INI....????", vbYesNo + vbCritical, "Konfirmasi") If Konfirmasi = vbYes Then Unload Me 1

Transcript of nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus....

Page 1: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

1. TUGAS 1

Private Sub Command1_Click()

Text1.SetFocus

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

End Sub

Private Sub Command2_Click()

Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM INI....????", vbYesNo + vbCritical, "Konfirmasi")

If Konfirmasi = vbYes Then

Unload Me

End If

1

Page 2: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

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

2

Page 3: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

2. TUGAS 2

Private Sub chkmiring_Click()

If (chktebal.Value = 1) And (chkmiring.Value = 1) Then

LabelNama.FontBold = True

LabelNama.FontItalic = True

ElseIf (chktebal.Value = 1) And (chkmiring.Value = 0) Then

LabelNama.FontBold = True

LabelNama.FontItalic = False

Private Sub chktebal_Click()

If (chktebal.Value = 1) And (chkmiring.Value = 1) Then

LabelNama.FontBold = True

3

Page 4: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

LabelNama.FontItalic = True

ElseIf (chktebal.Value = 1) And (chkmiring.Value = 0) Then

LabelNama.FontBold = True

LabelNama.FontItalic = False

ElseIf (chktebal.Value = 0) And (chkmiring.Value = 1) Then

LabelNama.FontBold = False

LabelNama.FontItalic = True

ElseIf (chktebal.Value = 0) And (chkmiring.Value = 0) Then

LabelNama.FontBold = False

LabelNama.FontItalic = False

End If

End Sub

Private Sub cmdok_Click()

LabelNama.Caption = (Text1.Text)

End Sub

Private Sub cmdselesai_Click()

Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM INI....????", vbYesNo + vbCritical, "Konfirmasi")

If Konfirmasi = vbYes Then

Unload Me

End If

4

Page 5: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

End Sub

Private Sub optmerah_Click()

If optmerah.Value = True Then

LabelNama.ForeColor = vbRed

End If

End Sub

Private Sub optbiru_Click()

If optbiru.Value = True Then

LabelNama.ForeColor = vbBlue

End If

End Sub

ElseIf (chktebal.Value = 0) And (chkmiring.Value = 1) Then

LabelNama.FontBold = False

LabelNama.FontItalic = True

ElseIf (chktebal.Value = 0) And (chkmiring.Value = 0) Then

LabelNama.FontBold = False

LabelNama.FontItalic = False

End If

End Sub

5

Page 6: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

3. TUGAS 3

Private Sub Command1_Click()

If (Chktebal.Value = 1) And (Chkgb.Value = 1) And (Chkmiring.Value = 1) Then

Text1.FontBold = True

Text1.FontItalic = True

Text1.FontUnderline = True

ElseIf (Chktebal.Value = 1) And (Chkgb.Value = 1) And (Chkmiring.Value = 0) Then

Text1.FontBold = True

Text1.FontItalic = True

Text1.FontUnderline = False

6

Page 7: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

ElseIf (Chktebal.Value = 1) And (Chkgb.Value = 0) And (Chkmiring.Value = 0) Then

Text1.FontBold = True

Text1.FontItalic = False

Text1.FontUnderline = False

ElseIf (Chktebal.Value = 1) And (Chkgb.Value = 0) And (Chkmiring.Value = 1) Then

Text1.FontBold = True

Text1.FontItalic = False

Text1.FontUnderline = True

ElseIf (Chktebal.Value = 0) And (Chkgb.Value = 0) And (Chkmiring.Value = 1) Then

Text1.FontBold = False

Text1.FontItalic = False

Text1.FontUnderline = True

ElseIf (Chktebal.Value = 0) And (Chkgb.Value = 0) And (Chkmiring.Value = 0) Then

Text1.FontBold = False

Text1.FontItalic = False

Text1.FontUnderline = False

ElseIf (Chktebal.Value = o) And (Chkgb.Value = 1) And (Chkmiring.Value = 1) Then

Text1.FontBold = False

Text1.FontItalic = True

Text1.FontUnderline = True

ElseIf (Chktebal.Value = o) And (Chkgb.Value = 1) And (Chkmiring.Value = 0) Then

Text1.FontBold = False

7

Page 8: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Text1.FontItalic = True

Text1.FontUnderline = False

End If

End Sub

4. TUGAS 4

Private Sub Command1_Click()

Dim A, B, C As String

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

End Sub

Private Sub Command2_Click()

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

End Sub

8

Page 9: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Private Sub Command3_Click()

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

End Sub

Private Sub Command4_Click()

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

End Sub

Private Sub Command5_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

End Sub

Private Sub Command6_Click()

Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM INI....????", vbYesNo + vbCritical, "Konfirmasi")

If Konfirmasi = vbYes Then

Unload Me

End If

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

9

Page 10: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

End Sub

5. TUGAS 5

Private Sub Command1_Click()

Dim HG, JP As Integer

Dim TB As Long

HG = Val(Text3.Text)

JP = Val(Text4.Text)

TB = (HG * JP)

Text5.Text = TB

Text5.SetFocus

10

Page 11: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

End Sub

Private Sub Command2_Click()

Text1.SetFocus

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

End Sub

Private Sub Command3_Click()

Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM INI, vbYesNo + vbCritical, "Konfirmasi")

If Konfirmasi = vbYes Then

Unload Me

End If

End Sub

Private Sub Form_Activate()

Text1.SetFocus

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

11

Page 12: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Text4.Text = ""

Text5.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

12

Page 13: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

6. TUGAS 6

Private Sub Cmdhitung_Click()

Dim A, B, C As Double

TXTB.Text = Val(TXTA.Text) * 0.1

TXTC.Text = Val(TXTA.Text) - Val(TXTB.Text)

End Sub

Private Sub Cmdquit_Click()

13

Page 14: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM INI, vbYesNo + vbCritical, "Konfirmasi")

If Konfirmasi = vbYes Then

Unload Me

End If

End Sub

Private Sub Cmdulangi_Click()

TXTA.Text = ""

TXTB.Text = ""

TXTC.Text = ""

End Sub

Private Sub TXTA_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTB.SetFocus

End If

End Sub

Private Sub TXTB_Change()

If KeyAscii = 13 Then

TXTC.SetFocus

End If

End Sub

14

Page 15: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

7. TUGAS 7

Private Sub TXTA_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTB.SetFocus

End If

End Sub

15

Page 16: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Private Sub CMDPROSES_Click()

Dim A, B, C, D, E, F As Double

TXTD.Text = Val(TXTA.Text) + Val(TXTB.Text) - Val(TXTC.Text)

TXTE.Text = Val(TXTD.Text) * 0.1

TXTF.Text = Val(TXTD.Text) - Val(TXTE.Text)

End Sub

Private Sub CMDULANG_Click()

TXTA.Text = ""

TXTB.Text = ""

TXTC.Text = ""

TXTD.Text = ""

TXTE.Text = ""

TXTF.Text = ""

End Sub

Private Sub TXTB_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTC.SetFocus

End If

End Sub

Private Sub CMDKELUAR_Click()

Private Sub Cmdquit_Click()

Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM INI, vbYesNo + vbCritical, "Konfirmasi")

If Konfirmasi = vbYes Then

Unload Me

16

Page 17: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

End If

End Sub

8. TUGAS 8

17

Page 18: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Private Sub Combo1_Click()

Dim NM, JR As String

Select Case Combo1.Text

Case "10201133"

NM = "NUR NOVI ARIA"

JR = "D3"

Case "10204455"

NM = "BAYU BANDORO"

JR = "SI"

Case "10253666"

NM = "LASTRI"

JR = "D3"

End Select

Text1.Text = NM

18

Page 19: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Text2.Text = JR

End Sub

Private Sub Command1_Click()

Dim NK, NT, UTS, UAS As Integer

Dim NA As Long

NK = Val(Text3.Text)

NT = Val(Text4.Text)

UTS = Val(Text5.Text)

UAS = Val(Text6.Text)

NA = (NK + NT + 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

19

Page 20: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Private Sub Command2_Click()

Combo1.SetFocus

Combo1.Text = ""

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

Text6.Text = ""

Text7.Text = ""

Text8.Text = ""

End Sub

Private Sub Command3_Click()

Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM INI....????", vbYesNo + vbCritical, "Konfirmasi")

If Konfirmasi = vbYes Then

Unload Me

End If

End Sub

Private Sub Form_Load()

Combo1.AddItem "10201133"

Combo1.AddItem "10204455"

Combo1.AddItem "10203666"

Select Case Combo1.Text

20

Page 21: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Case "10201133"

NM = "NUR NOVI ARIA"

JR = "D3"

Case "10204455"

NM = "BAYU BANDORO"

JR = "SI"

Case "10203666"

NM = "LASTRI"

JR = "D3"

End Select

Text1.Text = NM

Text2.Text = JR

End Sub

Private Sub COMBO1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text1.SetFocus

End If

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

21

Page 22: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

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

22

Page 23: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Private Sub Text6_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Command1.SetFocus

End If

End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text8.SetFocus

End If

End Sub

9. TUGAS 9

23

Page 24: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

24

Page 25: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Private Sub Cbgolongan_Click()

Dim GAPOK, PAJAK, TUNJANGAN, total As Variant

Select Case Cbgolongan.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

End Select

total = (GAPOK + TUNJANGAN)

PAJAK = (total) * 0.1

Text3.Text = GAPOK

Text4.Text = TUNJANGAN

Text5.Text = PAJAK

Text6.Text = total - PAJAK

Text6.Text = total

End Sub

25

Page 26: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Public Sub KOSONG()

Text1.SetFocus

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

Text6.Text = ""

Cbgolongan.Text = ""

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()

Cbgolongan.AddItem "I"

26

Page 27: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Cbgolongan.AddItem "II"

Cbgolongan.AddItem "III"

Cbgolongan.AddItem "IV"

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

10.TUGAS 10

27

Page 28: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Private Sub Command1_Click()

Dim jr, ps, tm, nu As Variant

Select Case Text2.Text

Case "10201001"

jr = "sistem informasi"

ps = "strata satu"

tm = "2010"

nu = "01"

Case "10201002"

jr = "sistem informasi"

ps = "diploma tiga"

tm = "2010"

nu = "02"

Case "10201003"

jr = "manajemen informatika"

ps = "strata satu"

tm = "2010"

nu = "03"

Case "10201133"

jr = "manajemen informatika"

ps = "diploma tiga"

tm = "2010"

nu = "33"

Case "10201005"

jr = "teknik informasi"

ps = "strata satu"

28

Page 29: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

tm = "2010"

nu = "05"

Case "10201006"

jr = "teknik informasi"

ps = "diploma tiga"

tm = "2010"

nu = "011"

Case "10201007"

jr = "teknik informasi"

ps = "diploma satu"

tm = "2010"

nu = "011"

Case "10201008"

jr = "teknik informasi"

ps = "diploma satu"

tm = "2010"

nu = "08"

Case "10201009"

jr = "teknik informasi"

ps = "diploma tiga"

tm = "2010"

nu = "09"

End Select

Text3.Text = jr

Text4.Text = ps

Text5.Text = tm

29

Page 30: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

Text6.Text = nu

End Sub

Private Sub Command2_Click()

Text1.SetFocus

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

Text6.Text = ""

End Sub

Private Sub Command3_Click()

Text1.SetFocus

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

Text6.Text = ""

End Sub

Private Sub Command4_Click()

Konfirmasi = MsgBox("APAKAH ANDA YAKIN AKAN KELUAR DARI PROGRAM IN, vbYesNo + vbCritical, "Konfirmasi")

If Konfirmasi = vbYes Then

Unload Me

30

Page 31: nurnoviari4.files.wordpress.com  · Web viewTUGAS 1. Private Sub Command1_Click() Text1.SetFocus. Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub. Private Sub Command2_Click()

End If

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

31