- Beranda
- Komunitas
- Tech
- Programmer Forum
CARA MEMBUAT SISTEM INFORMASI INVENTARIS DENGAN VISUAL BASIC 6.0 PLUS MS ACCESS


TS
ypermanaprovis
CARA MEMBUAT SISTEM INFORMASI INVENTARIS DENGAN VISUAL BASIC 6.0 PLUS MS ACCESS

Apa kabar agan2 yang seneng ngulik VB6, disini ane mau share, gimana sih cara bikin sistem informasi inventaris ? Nah kita simak programnya dulu gan

Ketika kita udah login tampilannya gini gan

Nah kita input datanya gan,

Kalo udah, klik LIHAT DATA, entar hasilnya gini gan

Nah sipkan

---===---
LANGKAH-LANGKAH PEMBUATAN PROGRAM
Pertama, Gunakan objek: Label, Text, Command, Adodc, DataGrid, dan Calendar gan

Kedua, Aturlah UI seperti yang ada di program
Ketiga, Tulis kode programnya gan:
Code:
Dim Total As Long
Private Sub Calendar1_Click()
Label1.Caption = Calendar1.Value
Calendar1.Visible = False
End Sub
Private Sub Command5_Click()
Command5.Font = "Trebuchet MS"
Text3.Text = "Nama Barang"
Text4.Text = "Jumlah Barang"
Text5.Text = "Harga Satuan"
Label6.Caption = "Total Harga:"
Label1.Caption = "Klik untuk mengisi tanggal"
Calendar1.Visible = False
End Sub
Private Sub Form_Load()
Label2.BackColor = vbRed
End Sub
Private Sub Label1_Click()
Calendar1.Visible = True
End Sub
Private Sub Label2_Click()
End
End Sub
Private Sub Label6_Click()
If IsNumeric(Text4.Text) And IsNumeric(Text5.Text) Then
Total = Val(Text4.Text) * Val(Text5.Text)
Label6.Caption = "Total Harga: " + Str(Total)
Else
Label6.Caption = "Total Harga: 0"
End If
End Sub
Private Sub Text1_GotFocus()
If (Text1.Text = "Username") Then
Text1.Text = ""
End If
End Sub
Private Sub Text1_LostFocus()
If (Text1.Text = "") Then
Text1.Text = "Username"
End If
End Sub
Private Sub Text2_Change()
Text2.PasswordChar = "*"
End Sub
Private Sub Text2_GotFocus()
If (Text2.Text = "Password") Then
Text2.Text = ""
End If
End Sub
Private Sub Text2_LostFocus()
If (Text2.Text = "") Then
Text2.Text = "Password"
End If
End Sub
Private Sub Text3_GotFocus()
If (Text3.Text = "Nama Barang") Then
Text3.Text = ""
End If
End Sub
Private Sub Text3_LostFocus()
If (Text3.Text = "") Then
Text3.Text = "Nama Barang"
End If
End Sub
Private Sub Text4_GotFocus()
If (Text4.Text = "Jumlah Barang") Then
Text4.Text = ""
End If
End Sub
Private Sub Text4_LostFocus()
If (Text4.Text = "") Then
Text4.Text = "Jumlah Barang"
End If
End Sub
Private Sub Text5_GotFocus()
If (Text5.Text = "Harga Satuan") Then
Text5.Text = ""
End If
End Sub
Private Sub Text5_LostFocus()
If (Text5.Text = "") Then
Text5.Text = "Harga Satuan"
End If
End Sub
'Command
Private Sub Command1_Click()
If conn.State = 1 Then conn.Close
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0 ; Data Source = Database.mdb ; Persist Security Info = False"
If RS.State = 1 Then RS.Close
RS.Open "Select * from admin where username='" & Text1.Text & "' and password='" & Text2.Text & "'", conn, 3, 3
If Not RS.EOF Then
MsgBox "Selamat Datang di Praktikum Provis"
Text1.Text = "Username"
Text2.Text = "Password"
Text1.Enabled = False
Text2.Enabled = False
Label5.Visible = False
Command1.Visible = False
Command2.Visible = True
Command3.Visible = True
Command4.Visible = True
Command5.Visible = True
Command6.Visible = True
Label1.Visible = True
Label6.Visible = True
Text3.Visible = True
Text4.Visible = True
Text5.Visible = True
Text1.Text = "Username"
Text2.Text = "Password"
Text2.PasswordChar = ""
Else
MsgBox "Username Atau Password Anda Salah", vbCritical, "LOGIN"
Text1.Text = "Username"
Text2.Text = "Password"
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()
Command1.Visible = True
Command2.Visible = False
Command3.Visible = False
Command4.Visible = False
Command5.Visible = False
Command6.Visible = False
Label1.Visible = False
Label6.Visible = False
Text3.Visible = False
Text4.Visible = False
Text5.Visible = False
DataGrid1.Visible = False
Label5.Visible = True
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Command3.Visible = True
Command4.Visible = True
Command5.Visible = True
Command6.Visible = True
Label1.Visible = True
Label6.Visible = True
Text3.Visible = True
Text4.Visible = True
Text5.Visible = True
DataGrid1.Visible = False
End Sub
Private Sub Command4_Click()
DataGrid1.DefColWidth = 2000
Command5.Visible = False
Command6.Visible = False
Label1.Visible = False
Label6.Visible = False
Text3.Visible = False
Text4.Visible = False
Text5.Visible = False
Call Koneksi
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0 ; Data Source = Database.mdb ; Persist Security Info = False"
Adodc1.RecordSource = "select * from barang"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
DataGrid1.Visible = True
End Sub
Private Sub Command6_Click()
If (Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Label6.Caption = "Total Harga:" Or Label1.Caption = "Klik untuk mengisi tanggal") Then
MsgBox "Isi data dengan lengkap !"
Else
Call Koneksi
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from barang"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("nama_barang") = Text3.Text
Adodc1.Recordset.Fields("tanggal_masuk") = Label1.Caption
Adodc1.Recordset.Fields("jumlah") = Text4.Text
Adodc1.Recordset.Fields("harga_satuan") = Text5.Text
Adodc1.Recordset.Fields("total_harga") = Total
Adodc1.Recordset.Update
MsgBox "Data telah terisi"
Text3.Text = "Nama Barang"
Text4.Text = "Jumlah Barang"
Text5.Text = "Harga Satuan"
Label6.Caption = "Total Harga:"
Label1.Caption = "Klik Untuk Mengisi tanggal"
Calendar1.Visible = False
End If
End Sub
Keempat, Simpan form dengan nama Form1, dan project dengan nama Project1
Kelima, tambahkan module, seperti ini gan:

Keenam, tulis kode pada jendela code module:
Code:
Public conn As New ADODB.Connection
Public RS As New ADODB.Recordset
Public RSData As New ADODB.Recordset
Sub Koneksi()
Set Konek = New ADODB.Connection
Set RSData = New ADODB.Recordset
Konek.Open "Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = Database.mdb ; Persist Security Info = False"
End Sub
Ketujuh, Simpan form dengan nama Module1
Kedelapan, tambahkan Data Environment, seperti ini gan:

Kesembilan, Buka MS Access nya gan

Kedua, kita bakalan bikin basis data di akses, pilih New

Nah ini penampakan nya gan

Ketiga, terus kita pilih Design New, dan ketikkan ‘Admin’, hasilnya gini

Terus ketik gini ya, jangan lupa pada properties required di ‘Yes’

Kesepuluh, simpan dengan nama Database.mdb
Kesebelas, buka VB6nya gan, lalu jalankan Project1
Selesai

ini link sourcenya [url]http://www.media*fire.com/download/1i7haveb4av7cau/TP7_A_1202304_Yana%20Permana[/url](2).rar
copy di url adress dan hilangkan tanda bintangnya...
Diubah oleh ypermanaprovis 21-11-2013 16:40


nona212 memberi reputasi
1
7.6K
9


Komentar yang asik ya
Urutan
Terbaru
Terlama


Komentar yang asik ya
Komunitas Pilihan