Tugas 4

TUGAS 4

Private Sub cmdno_Click()

End

End Sub

Private Sub cmdyes_Click()

Form1.Show

End Sub

Private Sub cmdbaru_Click()

Data1.Recordset.addnew

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub cmdkeluar_Click()

Form2.Show

End Sub

 

Private Sub cmdlagi_Click()

txtkode.SetFocus

txtkode = “”

txtht = “”

txtjk = “”

txtjb = “”

txtjt = “”

txttotal = “”

End Sub

 

Private Sub cmdproses_Click()

Dim s As String

s = Left(txtkode.Text, 3)

If s = “BIM” Then

txtjk.Text = “BIMA”

txtht.Text = “50000”

txtjb.Text = “16.00 WIB”

ElseIf s = “EKO” Then

txtjk.Text = “EKO”

txtht.Text = “35000”

txtjb.Text = “19.00 WIB”

ElseIf s = “MUT” Then

txtjk.Text = “MUTIARA”

txtht.Text = “23000”

txtjb.Text = “17.00 WIB”

ElseIf s = “SEN” Then

txtjk.Text = “SENJA”

txtht.Text = “15000”

txtjb.Text = “20.00 WIB”

End If

txttotal.Text = Val(txtht.Text) * Val(txtjt.Text)

End Sub

Private Sub cmdsimpan_Click()

Data1.Recordset.Update

End Sub

Private Sub txtjt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttotal.Text = Val(txtht.Text) * Val(txtjt.Text)

End If

End Sub

Private Sub txtkode_KeyPress(KeyAscii As Integer)

Dim s As String

s = Left(txtkode.Text, 3)

If s = “BIM” Then

txtjk.Text = “BIMA”

txtht.Text = “50000”

txtjb.Text = “16.00 WIB”

ElseIf s = “EKO” Then

txtjk.Text = “EKO”

txtht.Text = “35000”

txtjb.Text = “19.00 WIB”

ElseIf s = “MUT” Then

txtjk.Text = “MUTIARA”

txtht.Text = “23000”

txtjb.Text = “17.00 WIB”

ElseIf s = “SEN” Then

txtjk.Text = “SENJA”

txtht.Text = “15000”

txtjb.Text = “20.00 WIB”

End If

If KeyAscii = 13 Then

txtjt.SetFocus

End If

End Sub

 

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s