Kamis, 19 Januari 2012

Pemograman Jaringan (Form Pegawai)


Pemograman Jaringan
Listing Program Server
Public Db As New ADODB.Connection
Public rs As New ADODB.Recordset
Public rs2 As New ADODB.Recordset
Public sql As String

Sub OPENDB()
If Db.State = adStateOpen Then Db.Close
Db.CursorLocation = adUseClient
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & _
"\kepegawaian.mdb;Persist Security Info=False "
End Sub

Sub ClearFORM(f As Form)
Dim ctl As Control
For Each ctl In f
    If TypeOf ctl Is TextBox Then ctl.Text = ""
    If TypeOf ctl Is ComboBox Then ctl.Text = ""
Next
End Sub

Sub Center(f As Form)
f.Move (Screen.Width - f.Width) / 2, (Screen.Height - f.Height) / 4
End Sub

Sub RubahCMD(f As Form, L0 As Boolean, L1 As Boolean, L2 As Boolean, L3 As Boolean)
f.cmdproses(0).Enabled = L0
f.cmdproses(1).Enabled = L1
f.cmdproses(2).Enabled = L2
f.cmdproses(3).Enabled = L3
End Sub

FRM LOGIN
Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub cmdsubmit_Click()
If username.Text = "Beby" And pass.Text = "250290" Then
    Me.Hide
    menu.Show
Else
    MsgBox "Maaf! Username dan Password yang anda masukkan salah", vbInformation, "pemakai"
End If
End Sub


FRM MENU
Private Sub Keluar_Click()
Unload Me
End Sub

Private Sub Pegawai_Click()
FrmPegawai.Show
End Sub

FRM PEGAWAI

























Listing Program Client
Public SQL As String
Sub ClearFORM(f As Form)
Dim ctl As Control
For Each ctl In f
    If TypeOf ctl Is TextBox Then ctl.Text = ""
    If TypeOf ctl Is ComboBox Then ctl.Text = ""
Next
End Sub

Sub Center(f As Form)
f.Move (Screen.Width - f.Width) / 2, (Screen.Height - f.Height) / 4
End Sub

Sub RubahCMD(f As Form, L0 As Boolean, L1 As Boolean, L2 As Boolean, L3 As Boolean)
f.CmdProses(0).Enabled = L0
f.CmdProses(1).Enabled = L1
f.CmdProses(2).Enabled = L2
f.CmdProses(3).Enabled = L3
End Sub

FRM LOGIN
Private Sub Command1_Click()
If username.Text = "Desy" And pass.Text = "123456" Then
    Menu.Show
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub

                       

FRM MENU
Private Sub MDIForm_Load()
Menu.Show
End Sub
Private Sub Pegawai_Click()
FrmPegawai.Show
End Sub
                                   
FRM PEGAWAI








Tidak ada komentar:

Posting Komentar