0% found this document useful (0 votes)
112 views5 pages

Lat VB

The document contains Visual Basic code for an application that handles employee data, including setting job titles and salaries based on employee codes, calculating total salary with bonuses, and clearing all fields. It includes subroutines for clicking buttons to calculate values, activate and clear the form, and enable or disable fields. The code manages input and display of employee information as well as calculations.

Uploaded by

finehidayat
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views5 pages

Lat VB

The document contains Visual Basic code for an application that handles employee data, including setting job titles and salaries based on employee codes, calculating total salary with bonuses, and clearing all fields. It includes subroutines for clicking buttons to calculate values, activate and clear the form, and enable or disable fields. The code manages input and display of employee information as well as calculations.

Uploaded by

finehidayat
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Private Sub cbkode_Click() opt1.

Value = False
If cbkode.Text = "drk001" Then opt2.Enabled = True
txtjabatan.Text = "direktur" opt2.Value = False
txtgapok.Text = 5000000 Command1.Enabled = True
Else Command3.Enabled = True
If cbkode.Text = "mng002" Then Command4.Enabled = True
txtjabatan.Text = "manager" txtnama.SetFocus
txtgapok.Text = 3000000 End Sub
Else
txtjabatan.Text = "karyawan" Private Sub Command3_Click()
txtgapok.Text = 1000000 txtnama.Text = ""
End If cbkode.Text = ""
End If txtjabatan.Text = ""
End Sub txttunj.Text = ""
txtgapok.Text = ""
Private Sub Command1_Click() txtgaber.Text = ""
txtgaber.Text = Val(txtgapok.Text) + opt1.Value = False
Val(txttunj.Text) opt2.Value = False
End Sub End Sub

Private Sub Command2_Click() Private Sub Form_Activate()


txtnama.Enabled = True txtnama.Enabled = False
cbkode.Enabled = True cbkode.Enabled = False
txttunj.Enabled = True txtjabatan.Enabled = False
txtjabatan.Enabled = True txttunj.Enabled = False
txtgapok.Enabled = True txtgapok.Enabled = False
txtgaber.Enabled = True txtgaber.Enabled = False
opt1.Enabled = True opt1.Enabled = False
opt2.Enabled = False If opt1.Value = True Then
Command1.Enabled = False txttunj.Text = Val(txtgapok.Text) *
Command3.Enabled = False 0.3
Command4.Enabled = False End If
End Sub End Sub

Private Sub Form_Load() Private Sub opt2_Click()


cbkode.AddItem ("drk001") If opt2.Value = True Then
cbkode.AddItem ("mng002") txttunj.Text = Val(txtgapok.Text) *
cbkode.AddItem ("kr001") 0.1
End Sub End If
End Sub
Private Sub opt1_Click()
Private Sub cbkode_Click() ElseIf txtjml.Text > 3 Then
If cbkode.Text = "T" Then txtpot.Text = 2 / 100 *
txtmerk.Text = "TOP ONE" Val(txtharga.Text)
txtharga.Text = 85000 txtppn.Text = 2 / 100 *
ElseIf cbkode.Text = "P" Then Val(txtharga.Text)
txtmerk.Text = "PENZOLI" Else
txtharga.Text = 65000 txtpot.Text = 0
Else txtppn.Text = 2 / 100 *
txtmerk.Text = "REPSOL" Val(txtharga.Text)
txtharga.Text = 75000 End If
End If txttotal.Text = (Val(txtharga.Text) *
End Sub Val(txtjml.Text)) + Val(txtservice.Text)
+ Val(txtppn.Text) - Val(txtpot.Text)
Private Sub cmdhitung_Click() txtpot.Enabled = False
If txtjml.Text > 5 Then txtppn.Enabled = False
txtpot.Text = 5 / 100 * txttotal.Enabled = False
Val(txtharga.Text) End Sub
txtppn.Text = 2 / 100 *
Val(txtharga.Text) Private Sub cmdlagi_Click()
Call bersih txtpot.Enabled = True
End Sub txtppn.Enabled = True
txttotal.Enabled = True
Private Sub cmdmulai_Click() txtbayar.Enabled = True
Call aktif txtkembali.Enabled = True
Call bersih cmdhitung.Enabled = True
End Sub cmdlagi.Enabled = True
cmdkeluar.Enabled = True
Private Sub Form_Activate() End Sub
Call tidakaktif
Call bersih Sub tidakaktif()
End Sub cbkode.Enabled = False
txtjml.Enabled = False
Private Sub Form_Load() txtmerk.Enabled = False
cbkode.AddItem ("T") txtharga.Enabled = False
cbkode.AddItem ("P") opt1.Enabled = False
cbkode.AddItem ("R") opt2.Enabled = False
End Sub txtservice.Enabled = False
txtpot.Enabled = False
Private Sub opt1_Click() txtppn.Enabled = False
If opt1.Value = True Then txttotal.Enabled = False
txtservice.Text = 150000 txtbayar.Enabled = False
End If txtkembali.Enabled = False
End Sub cmdhitung.Enabled = False
cmdlagi.Enabled = False
Private Sub opt2_Click() cmdkeluar.Enabled = False
If opt2.Value = True Then End Sub
txtservice.Text = 95000
End If Sub bersih()
End Sub cbkode.Text = ""
txtjml.Text = ""
Private Sub txtbayar_Change() txtmerk.Text = ""
txtkembali.Text = Val(txtbayar.Text) - txtharga.Text = ""
Val(txttotal.Text) opt1.Value = False
End Sub opt2.Value = False
txtservice.Text = ""
Sub aktif() txtpot.Text = ""
cbkode.Enabled = True txtppn.Text = ""
txtjml.Enabled = True txttotal.Text = ""
txtmerk.Enabled = True txtbayar.Text = ""
txtharga.Enabled = True txtkembali.Text = ""
opt1.Enabled = True End Sub
opt2.Enabled = True
txtservice.Enabled = True

You might also like