Senin, 12 Desember 2011

contoh program vb




  TABLE NASABAH





























Perhatikan listing programnya
SAVE
Private Sub Command1_Click()
Data2.Recordset.AddNew
Data2.Recordset(0) = Text1.Text
Data2.Recordset(1) = Text2.Text
Data2.Recordset(2) = Text3.Text
Data2.Recordset(3) = Text4.Text
Data2.Recordset(4) = Text5.Text
Data2.Recordset(5) = Text6.Text
Data2.Recordset(6) = Text7.Text
Data2.Recordset(7) = Text8.Text
Data2.Recordset(8) = Text9.Text
Data2.Recordset(9) = Text10.Text
Data2.Recordset(10) = Text11.Text
Data2.Recordset(11) = Text12.Text
Data2.Recordset(12) = Text13.Text
Data2.Recordset(13) = Text14.Text
Data2.Recordset(15) = Text16.Text
Data2.Recordset(16) = Text17.Text
Data2.Recordset(17) = Text18.Text
Data2.Recordset(18) = Text19.Text
Data2.UpdateRecord
End Sub



Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
End Sub
DELETE
Private Sub Command5_Click()
Data2.Recordset.Delete
Data2.Recordset.MoveNext
End Sub
TANGGAL
Private Sub Form_Load()
Text3.Text = Format(Date, "dd/MM/yyyy")
End Sub
ID, ketik kan id maka akan secara otomatik muncul nama.no.rek,saldo,bunga,serta pot
Private Sub Text1_Change()
If Text1.Text = "01" Then
Text4.Text = "03105560"
Text5.Text = "irma yanti"
Text8.Text = "6000000"
Text14.Text = Val(Text8.Text) * 0.02
Text17.Text = 5000
Else
If Text1.Text = "02" Then
Text4.Text = "03105561"
Text5.Text = "Novita"
Text8.Text = "4000000"
Text14.Text = Val(Text8.Text) * 0.02
Text17.Text = 5000
End If
End If
End Sub


KASIR
Private Sub Text12_Change()
If Text12.Text = "K1" Then
Text13.Text = "rika"
Else
If Text12.Text = "K2" Then
Text13.Text = "ani"
End If
End If
End Sub
POT=POT
Private Sub Text14_Change()
If Text14.Text = Text14.Text Then
Text16.Text = Text14.Text
End If

End Sub
TOT BUNGA=TOT BUNGA
Private Sub Text16_Change()
If Text16.Text = Text16.Text Then
Text9.Text = Text16.Text
End If
End Sub



Private Sub Text18_Change()
Text19.Text = Val(Text17.Text) + Val(Text18.Text)
End Sub

Private Sub Text19_Change()
If Text19.Text = Text19.Text Then
Text10.Text = Text19.Text
End If
End Sub

Private Sub Text7_Change()
If Text7.Text <= 5000000 Then
Text18.Text = "3000"
Else
If Text7.Text <= 10000000 Then
Text18.Text = "6000"
End If
End If
End Sub

Private Sub Text8_Click()
Text8.Text = Val(Text8.Text) - Val(Text7.Text)
Text8.Text = Val(Text8.Text) + Val(Text6.Text)
Text11.Text = Val(Text8.Text) + Val(Text9.Text) - Val(Text10.Text)
End Sub
JAM
Private Sub Timer1_Timer()
Text2.Text = Time
End Sub

















Tidak ada komentar:

Posting Komentar