input data di VB dengan menggunakan kode

input data

Private Sub Command1_Click(Index As Integer)
Dim s As String
txtth.Text = Left(Text2.Text, 4)
s = Mid(Text2.Text, 5, 1)
If s = “A” Then
txtgol.Text = “A”
txtjb.Text = “Manager”
txtgp.Text = “4000000”
txttj.Text = “1025000”
ElseIf s = “B” Then
txtgol.Text = “B”
txtjb.Text = ” Ka. Seksi”
txtgp.Text = “3500000”
txttj.Text = “975000”
ElseIf s = “C” Then
txtgol.Text = “C”
txtjb.Text = “Staff”
txtgp.Text = “3000000”
txttj.Text = “925000”
End If
s = Mid(Text2.Text, 7, 1)
If s = “S” Then
txtkod.Text = “S”
txtst.Text = “Singel”
ElseIf s = “M” Then
txtkod.Text = “M”
txtst.Text = “Menikah”
ElseIf s = “J” Then
txtkod.Text = “J”
txtst.Text = “Janda”
ElseIf s = “D” Then
txtkod.Text = “D”
txtst.Text = “Duda”
End If
s = Mid(Text2.Text, 9, 3)
If s = “KEU” Then
txtbg.Text = “Accounting”
ElseIf s = “ADM” Then
txtbg.Text = “Administrasi”
ElseIf s = “SDM” Then
txtbg.Text = “General Affair”
ElseIf s = “EDP” Then
txtbg = “IT Unit”
ElseIf s = “Spm” Then
txtbg.Text = “Security”
End If
txttg.Text = Val(txtgp.Text) + Val(txttj.Text)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
txtgol.Text = “”
txtkod.Text = “”
txtst.Text = “”
txtth.Text = “”
txtjb.Text = “”
txtbg.Text = “”
txtgp.Text = “”
txttj.Text = “”
txttg.Text = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
txtgol.Text = “”
txtkod.Text = “”
txtst.Text = “”
txtth.Text = “”
txtjb.Text = “”
txtbg.Text = “”
txtgp.Text = “”
txttj.Text = “”
txttg.Text = “”
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
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