Halo Sobat Tutorial VB, Berikut dibawah adalah langkah dalam membuat Form Admin / Kasir :
Buat lah design Form Admin atau Kasir seperti gambar dibawah :
Agar Form Admin bisa berjalan semestinya, gunakan pembelajaran dibawah ini.
Cara Input Database
Cara Edit Database
Cara Hapus database
Masukan Koding dibawah ini :
Dim mvBookMark As Variant
Private Sub Command1_Click()
Call BukaDB
Dim SQLTambah As String
SQLTambah = "Insert Into Admin (KodeAdmin,NamaAdmin,passwordAdmin,levelAdmin) values ('" & Text1 & "','" & Text2 & "','" & Text3 & "','" & Combo1 & "')"
koneksi.Execute SQLTambah
MsgBox "Data Berhasil diinput"
Form_Activate
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Sub Form_Load()
Text1.MaxLength = 6
Text2.MaxLength = 20
Text3.MaxLength = 15
Text3.PasswordChar = "X"
End Sub
Private Sub Form_Activate()
Call BukaDB
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\DBAplikasi.mdb; "
Adodc1.RecordSource = "select KodeAdmin,NamaAdmin, LevelAdmin from Admin"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
DataGrid1.Columns(0).Width = 1000: DataGrid1.Columns(0).Locked = True
DataGrid1.Columns(1).Width = 2300: DataGrid1.Columns(1).Locked = True
DataGrid1.Columns(2).Width = 1200: DataGrid1.Columns(2).Locked = True
Command1.SetFocus
Combo1.Clear
Combo1.AddItem "USER"
Combo1.AddItem "ADMIN"
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
Jika ada kesulitan bisa melihat video tutorialnya Disini
0 komentar:
Posting Komentar