P. 1
PDF Visual Basic

PDF Visual Basic

|Views: 608|Likes:
Dipublikasikan oleh dejark

More info:

Published by: dejark on Mar 14, 2011
Hak Cipta:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/03/2012

pdf

text

original

Option Explicit
Dim Beli As String

Private Sub cmdCetak_Click()
CR1.ReportFileName

=

App.Path

&

"\REPORT\Faktur

Penjualan.rpt"

CR1.SQLQuery = "Select * FRom VPenjualan Where
NoFaktur_jual= '" & Txt_Faktur.Text & "'"
CR1.Action = 1
CR1.WindowState = crptMaximized

End Sub

Private Sub cmdHapus_Click()
On Error GoTo Salah
AdoJual.Recordset.Delete
Call JumlahData
Exit Sub

Salah:

MsgBox "Tidak Dapat Menghapus Data !", vbOKOnly, "Error"

End Sub

Private Sub cmdkalkulator_Click()
AppActivate Shell("CALC.EXE")

End Sub

Private Sub cmdRincian_Click()
FormPenjualanDetail.AdoDTJual.RecordSource = "Select *
from

detail_jual

Where

NoFaktur_jual

=

'"

&

Txt_Faktur.Text & "' "
FormPenjualanDetail.AdoDTJual.Refresh
FormPenjualanDetail.Show vbModal

End Sub

Private Sub cmdSimpan_Click()
On Error GoTo Salah
AdoJual.Recordset.Update
AdoJual.Refresh
Call JumlahData
cmdTambah.SetFocus
Exit Sub

Salah:

MsgBox "Data Belum Lengkap, COBA LAGI !", vbOKOnly,

"Error"
End Sub

Private Sub cmdTambah_Click()

Universitas Sumatera Utara

On Error GoTo Salah
AdoJual.Recordset.AddNew
Txt_Faktur.SetFocus
Exit Sub

Salah:

MsgBox "Proses Penambahan Data Terjadi Error", vbOKOnly,

"Error"
End Sub

Private Sub cmdTutup_Click()
Dim pesan As String
pesan = MsgBox("Apakah Anda Yakin Mau Mengakhiri ?",
vbYesNo + vbCritical, "Konfirmasi")
If pesan = vbYes Then Unload Me

End Sub
Private Sub ListPelanggan_DblClick()
ListPelanggan_LostFocus

End Sub

Private Sub ListPelanggan_LostFocus()
Txt_KdPelanggan.Text = Left(ListPemasok.Text, 5)
ListPelanggan.Visible = False

End Sub

Private Sub Txt_CBulan_Change()
AdoJual.RecordSource = "select * from jual WHERE
MONTH(TANGGAL_jual)= '" & Txt_CBulan.Text & "' AND
YEAR(TANGGAL_jual)= '" & Txt_Ctahun.Text & "'"
AdoJual.Refresh
JumlahData

End Sub

Private Sub Txt_Ctahun_Change()
AdoJual.RecordSource = "select * from jual WHERE
MONTH(TANGGAL_jual)= '" & Txt_CBulan.Text & "' AND
YEAR(TANGGAL_jual)= '" & Txt_Ctahun.Text & "'"
AdoJual.Refresh
JumlahData

End Sub

Private Sub Txt_Kdpelanggan_Change()
Txt_UPelanggan.Text

=

FieldValue("pelanggan",

"nama_pelanggan",

"kode_pelanggan=

'"

&

Txt_KdPelanggan.Text & "'")

End Sub

Private Sub Txt_KdPelanggan_Change()
Txt_UPelanggan.Text

=

FieldValue("Pelanggan",

"Nama_Pelanggan",

"Kode_Pelanggan

=

'"

&

Txt_KdPelanggan.Text & "'")

End Sub

Private Sub Txt_Kdpelanggan_KeyPress(keyascii As Integer)
If keyascii = 13 Or keyascii = 32 Then
ListPelanggan.Clear

Universitas Sumatera Utara

Call IsiListPelanggan
ListPelanggan.Visible = True
ListPelanggan.ZOrder (0)
End If

End Sub

Sub IsiListPelanggan()
ListPelanggan.Clear
sql = "select * From pelanggan"
pRS.CursorLocation = adUseClient
pRS.Open sql, StrConn
While Not pRS.EOF
ListPelanggan.AddItem

pRS.Fields("Kode_pelanggan")

&

vbTab & pRS.Fields("Nama_pelanggan")
pRS.MoveNext
Wend
pRS.Close

End Sub

Sub JumlahData()
Call Init
L_Count

=

"Jumlah

Record

=

"

&

AdoJual.Recordset.RecordCount
AdoJual.Refresh

End Sub

Private Sub Form_Load()
Call JumlahData
Txt_CBulan.Text = nBulan
Txt_Ctahun.Text = ntahun

End Sub

Private Sub ListPelanggan_DblClick()
ListPelanggan_LostFocus

End Sub

Private Sub ListPelanggan_LostFocus()
Txt_KdPelanggan.Text = Left(ListPelanggan.Text, 5)
ListPelanggan.Visible = False

End Sub

You're Reading a Free Preview

Mengunduh
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->