VISUAL BASIC DATABASE

DATA BASE 2

Private Sub cmdbaru_Click()

Data1.Recordset.AddNew

txtnama.SetFocus

End Sub

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

Private Sub cmdkeluar_Click()

Unload Me

End Sub

Private Sub cmdproses_Click()

Dim S As String

txttm.Text = “20” & Left(txtnpm.Text, 2)

S = Mid(txtnpm.Text, 3, 1)

If S = “1” Then

jur = “Sistem Informasi”

ElseIf S = “2” Then

jur = “Manajemen Informatika”

ElseIf S = “3” Then

jur = “Tehnik Informatika”

ElseIf S = “4” Then

jur = “Manajemen & Komp. Akuntansi”

End If

txtjur.Text = jur

S = Mid(txtnpm.Text, 4, 2)

If S = “00” Then

PS = “Strata Satu”

ElseIf S = “01” Then

PS = “Diploma Tiga”

ElseIf S = “02” Then

PS = “Diploma Empat”

ElseIf S = “03” Then

PS = “Diploma Dua”

End If

txtps.Text = PS

txtnu.Text = Right(txtnpm.Text, 3)

End Sub

Private Sub cmdsimpan_Click()

Data1.Recordset.Update

End Sub

 

 

Advertisements

Tugas visual basic 5

mursalin 5

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub

 

Private Sub Command2_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

 

Private Sub Command3_Click()
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub

 

Private Sub Command4_Click()
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub

 

Private Sub Command5_Click()
End
End Sub

 

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

 

jawaban soal visual basic

Jawab

Private sub text 1_key press (key Asc 11 AS integer)

If key Asc 11 : 13 then

Text 2 set focus

End if

End sub

 

Private sub text 2_key press (key Asc 11 AS integer)

If key Asc 11 : 13 then

Text 3 text : val (text 1 text)+val(text 2 text)

End if

End sub

 

Private sub command_click ( )

Text 3 text : val (text 1 text)+val (texs2 texs)

End sub

 

Private sub command click ( )

Text2 text : val (text1 text)* 0.1

Text3 text : val (text1 text) – (text 2 text)

End if

End sub

 

 

 

Private sub command click ( )

Text set focus

Text 1 : “ “

Text 2 : “ “

Text 3 : “ “

End sub

Private sub command 3 click

End if

End sub

 

Private sub text 1_key press (key Asc 11 AS integer)

If key Asc 11 : 13 then

Text 2 text set focus

End if

End sub

 

Private sub text 2_key press (key Asc 11 AS integer)

If key Asc 11 : 13 then

Text 3 text set focus

End if

End sub

 

 

 

 

 

Private sub command 1_text 1_key press

Text 4 text : val (text 1 text) + val (text 2 text) – (text 3 text)

Text 5 text : val (text 4 text) * 0.1

Text 6 text : val (text 4 text) – val (text 5 text)

End sub