Contoh Program Surat masuk keluar VB6

Contoh Program Surat masuk- keluar (VB6)
FORM1
Public gblApplication_User As String
Private Sub Form_Load()
koneksi
End Sub
Private Sub mnuexit_Click()
End
End Sub
Private Sub mnukeluar_Click()
Form9.Show
Form1.Hide
End Sub
Private Sub mnulogin_Click()
Form2.Show
Form1.Hide
End Sub
Private Sub koneksi()
Set Con = New ADODB.Connection
Con.Open ("Driver=SQL Server;Server=USER-PC;Database=surat;uid=sa;pwd=sa")
End Sub

Private Sub mnumasuk_Click()
Form8.Show
Form1.Hide
End Sub
FORM2
Private Sub Command1_Click()
Dim strquery As String
Set rs = New ADODB.Recordset
strquery = "SELECT * FROM login WHERE user_id='" & Text1.Text & "' AND password='" &
Text2.Text & "'"
rs.CursorLocation = 3
rs.Open strquery, Con, 1, 3
If rs.RecordCount = 0 Then
MsgBox "Anda Tidak Terdaftar Sebagai Operator"
Else

Form2.Hide
Form3.Show
Form1.Hide
End If

If Text1.Text = "akbar" Then
Form3.mnudaftar.Enabled = True
Else
Form3.mnudaftar.Enabled = False
End If
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Command2_Click()
Unload Me
Form1.Show
End Sub
Private Sub Form_Load()
Dim sql As String
Text1.Text = ""
Text2.Text = ""
End Sub
FORM3
Dim rs As New ADODB.Recordset
Dim Con As New ADODB.Connection

Private Sub Form_Load()
Con.Open ("Driver=SQL Server;Server=USER-PC;Database=surat;uid=sa;pwd=sa")
End Sub
Private Sub mnulap_Click()
DataReport1.Show
End Sub
Private Sub mnudaftar_Click()
Form10.Show
Form3.Hide
End Sub
Private Sub mnulogout_Click()
Form3.Hide
Form1.Show
End Sub
Private Sub mnusk_Click()
Form7.Show

Form3.Hide
End Sub
Private Sub mnusm_Click()

Form6.Show
End Sub
Private Sub mnusuke_Click()
Form5.Show
Form3.Hide
End Sub
Private Sub mnusuma_Click()
Form4.Show
Form3.Hide
End Sub

FORM4
Dim rs As New ADODB.Recordset
Dim Con As New ADODB.Connection
Private Sub Command1_Click()
Set rs = New ADODB.Recordset
rs.Open ("select * from masuk where No_Urut='" & Text1.Text & "'"), Con, 1, 3
If rs.RecordCount = 0 Then
MsgBox "Data Tidak ada!", vbCritical, "Info"
Else

Text2.Text = rs!No_Urut
Text3.Text = rs!Pengirim
Text4.Text = rs!Tanggal_Surat
Text5.Text = rs!No_Surat
Text6.Text = rs!Perihal
Text7.Text = rs!No_Petunjuk
Text8.Text = rs!Keterangan
Set rs = Con.Execute("select * from masuk where No_Urut='" & Text1.Text & "'")
Set MSHFlexGrid1.DataSource = rs
End If
End Sub
Private Sub Command2_Click()
Form3.Show
Form4.Hide
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""


Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Con.Open ("Driver=SQL Server;Server=USER-PC;Database=surat;uid=sa;pwd=sa")
Set rs = Con.Execute("select * from masuk")
Set MSHFlexGrid1.DataSource = rs
End Sub
FORM5
Dim rs As New ADODB.Recordset

Dim Con As New ADODB.Connection
Private Sub Command1_Click()
Set rs = New ADODB.Recordset
rs.Open ("select * from keluar where No_Urut='" & Text1.Text & "'"), Con, 1, 3
If rs.RecordCount = 0 Then
MsgBox "Data Tidak ada!", vbCritical, "Info"
Else
Text2.Text = rs!No_Urut
Text3.Text = rs!Tujuan
Text4.Text = rs!lTanggal_Surat
Text5.Text = rs!Perihal
Text6.Text = rs!Petunjuk
Text7.Text = rs!Keterangan
Set rs = Con.Execute("select * from keluar where No_Urut='" & Text1.Text & "'")
Set MSHFlexGrid1.DataSource = rs
End If
End Sub
Private Sub Command2_Click()
Form5.Hide
Form3.Show

End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""

End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Con.Open ("Driver=SQL Server;Server=USER-PC;Database=surat;uid=sa;pwd=sa")

Set rs = Con.Execute("select * from keluar")
Set MSHFlexGrid1.DataSource = rs
End Sub
FORM6
Dim rs As New ADODB.Recordset
Dim Con As New ADODB.Connection
Private Sub Command1_Click()
Con.Execute ("insert into masuk values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text
& "')")
Set rs = Con.Execute("select * from masuk")
Set MSHFlexGrid1.DataSource = rs
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub

Private Sub Command2_Click()
Con.Execute ("update masuk set No_Urut='" & Text1.Text & "',Pengirim='" & Text2.Text &
"',Tanggal_Surat='" & Text3.Text & "',No_Surat='" & Text4.Text & "',Perihal='" & Text5.Text
& "',No_Petunjuk='" & Text6.Text & "',Keterangan='" & Text7.Text & "' where No_Urut='" &
Text1.Text & "'")
Set rs = Con.Execute("select * from masuk")
Set MSHFlexGrid1.DataSource = rs
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub Command3_Click()
Set rs = New ADODB.Recordset

rs.Open ("select * from masuk where No_Urut='" & Text1.Text & "'"), Con, 1, 3
If rs.RecordCount = 0 Then

MsgBox "Data Tidak ada!", vbCritical, "Info"
Else
Text1.Text = rs!No_Urut
Text2.Text = rs!Pengirim
Text3.Text = rs!Tanggal_Surat
Text4.Text = rs!No_Surat
Text5.Text = rs!Perihal
Text6.Text = rs!No_Petunjuk
Text7.Text = rs!Keterangan
Set rs = Con.Execute("select * from masuk where No_Urut='" & Text1.Text & "'")
Set MSHFlexGrid1.DataSource = rs
End If
End Sub
Private Sub Command4_Click()
Con.Execute ("delete from masuk where No_Urut='" & Text1.Text & "'")
Set rs = Con.Execute("select * from masuk")
Set MSHFlexGrid1.DataSource = rs
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub Command5_Click()
Form3.Show
Form6.Hide
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Con.Open ("Driver=SQL Server;Server=USER-PC;Database=surat;uid=sa;pwd=sa")
Set rs = Con.Execute("select * from masuk")
Set MSHFlexGrid1.DataSource = rs
End Sub

FORM7
Dim rs As New ADODB.Recordset
Dim Con As New ADODB.Connection
Private Sub Command1_Click()
Con.Execute ("insert into keluar values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "')")
Set rs = Con.Execute("select * from keluar")
Set MSHFlexGrid1.DataSource = rs
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Private Sub Command2_Click()
Con.Execute ("update keluar set No_Urut='" & Text1.Text & "',Tujuan='" & Text2.Text &
"',Tanggal_Surat='" & Text3.Text & "',Perihal='" & Text4.Text & "',No_Petunjuk='" &
Text5.Text & "',Keterangan='" & Text6.Text & "' where No_Urut='" & Text1.Text & "'")
Set rs = Con.Execute("select * from masuk")
Set MSHFlexGrid1.DataSource = rs
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Private Sub Command3_Click()
Set rs = New ADODB.Recordset
rs.Open ("select * from keluar where No_Urut='" & Text1.Text & "'"), Con, 1, 3
If rs.RecordCount = 0 Then
MsgBox "Data Tidak ada!", vbCritical, "Info"
Else
Text2.Text = rs!No_Urut
Text3.Text = rs!Tujuan
Text4.Text = rs!lTanggal_Surat
Text5.Text = rs!Perihal
Text6.Text = rs!Petunjuk
Text7.Text = rs!Keterangan
Set rs = Con.Execute("select * from keluar where No_Urut='" & Text1.Text & "'")
Set MSHFlexGrid1.DataSource = rs
End If
End Sub
Private Sub Command4_Click()
Con.Execute ("delete from keluar where No_Urut='" & Text1.Text & "'")

Set rs = Con.Execute("select * from keluar")
Set MSHFlexGrid1.DataSource = rs
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Private Sub Command5_Click()
Form7.Hide
Form3.Show
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Private Sub Form_Load()
Con.Open ("Driver=SQL Server;Server=USER-PC;Database=surat;uid=sa;pwd=sa")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Set rs = Con.Execute("select * from keluar")
Set MSHFlexGrid1.DataSource = rs
End Sub
FORM8
Dim rs As New ADODB.Recordset
Dim Con As New ADODB.Connection
Private Sub Command1_Click()
Set rs = New ADODB.Recordset
rs.Open ("select * from masuk where No_Urut='" & Text1.Text & "'"), Con, 1, 3
If rs.RecordCount = 0 Then
MsgBox "Data Tidak ada!", vbCritical, "Info"
Else
Text2.Text = rs!No_Urut
Text3.Text = rs!Pengirim
Text4.Text = rs!Tanggal_Surat
Text5.Text = rs!No_Surat
Text6.Text = rs!Perihal
Text7.Text = rs!No_Petunjuk
Text8.Text = rs!Keterangan
Set rs = Con.Execute("select * from masuk where No_Urut='" & Text1.Text & "'")
Set MSHFlexGrid1.DataSource = rs
End If
End Sub

Private Sub Command2_Click()
Form1.Show
Form8.Hide
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
End Sub
Private Sub File1_Click()
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Con.Open ("Driver=SQL Server;Server=USER-PC;Database=surat;uid=sa;pwd=sa")
Set rs = Con.Execute("select * from masuk")
Set MSHFlexGrid1.DataSource = rs
End Sub
FORM9
Dim rs As New ADODB.Recordset
Dim Con As New ADODB.Connection
Private Sub Command1_Click()
Set rs = New ADODB.Recordset
rs.Open ("select * from keluar where No_Urut='" & Text1.Text & "'"), Con, 1, 3
If rs.RecordCount = 0 Then
MsgBox "Data Tidak ada!", vbCritical, "Info"
Else
Text2.Text = rs!No_Urut
Text3.Text = rs!Tujuan
Text4.Text = rs!Tanggal_Surat
Text5.Text = rs!Perihal
Text6.Text = rs!No_Petunjuk
Text7.Text = rs!Keterangan
Set rs = Con.Execute("select * from keluar where No_Urut='" & Text1.Text & "'")

Set MSHFlexGrid1.DataSource = rs
End If
End Sub
Private Sub Command2_Click()
Form9.Hide
Form1.Show
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Con.Open ("Driver=SQL Server;Server=USER-PC;Database=surat;uid=sa;pwd=sa")
Set rs = Con.Execute("select * from keluar")
Set MSHFlexGrid1.DataSource = rs
End Sub
FORM10
Dim rs As New ADODB.Recordset
Dim Con As New ADODB.Connection
Private Sub Command1_Click()
Con.Execute ("insert into login values('" & Text1.Text & "','" & Text2.Text & "')")
Set rs = Con.Execute("select * from login")
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Command2_Click()
Unload Me
Form1.Show
End Sub
Private Sub Form_Load()
Con.Open ("Driver=SQL Server;Server=RPL_01;Database=surat;uid=sa;pwd=sa")
Text1.Text = ""
Text2.Text = ""

End Sub
MODULE
Public Con As ADODB.Connection
Public rs As ADODB.Recordset

selamat mencoba yach :) :D

Dokumen yang terkait

MANAJEMEN PEMROGRAMAN PADA STASIUN RADIO SWASTA (Studi Deskriptif Program Acara Garus di Radio VIS FM Banyuwangi)

29 282 2

PENGEMBANGAN PROGRAM ACARA CHATZONE(Studi Terhadap Manajemen Program Acara di Stasiun Televisi Lokal Agropolitan Televisi Kota Batu)

0 39 2

Konstruksi Media tentang Kontroversi Penerimaan Siswa Baru di Kota Malang (Analisis Framing pada Surat Kabar Radar Malang Periode 30 Juni – 3 Juli 2012)

0 72 56

Perilaku Kesehatan pada Mahasiswa Program Studi Pendidikan Dokter UIN Syarif Hidayatullah Jakrta Angkatan 2012 pada tahun2015

8 93 81

Implementasi Program Dinamika Kelompok Terhada Lanjut Usia Di Panti Sosial Tresna Werdha (Pstw) Budi Mulia 1 Cipayung Jakarta Timur

10 166 162

Analisis Prioritas Program Pengembangan Kawasan "Pulau Penawar Rindu" (Kecamatan Belakang Padang) Sebagai Kecamatan Terdepan di Kota Batam Dengan Menggunakan Metode AHP

10 65 6

Prosedur Verifikasi Internal Surat Pertanggung Jawaban (SPJ) Pada Badan Perencanaan Pembangunan Daerah Provinsi Jawa Barat

2 110 1

Sistem Informasi Pendaftaran Mahasiswa Baru Program Beasiswa Unggulan Berbasis Web Pada Universitas Komputer Indonesia

7 101 1

Prosedur Pelaporan Surat Pemberitahuan Pajak Pengahsilan (SPT PPn) Dengan Menggunakan Elektronik Surat Pemberitahuan (E-SPT PPn 1111) Pada PT. INTI (Persero) Bandung

7 57 61

Peranan Komunikasi Antar Pribadi Antara Pengajar Muda dan Peserta Didik Dalam Meningkatkan Motivasi Belajar ( Studi pada Program Lampung Mengajar di SDN 01 Pulau Legundi Kabupaten Pesawaran )

3 53 80