Sei sulla pagina 1di 15

KODE SCRIP PROGRAM

FORM LOGIN

KODE PROGRAM

Private Sub cmdmasuk_Click() If txtnama.Text = "muszar" And txtpass.Text = "12345" Then Form2.Show Unload Me Else MsgBox "Periksa kembali User Name dan Password Anda!", vbExclamation, "Salah...!" txtnama.SetFocus: '"{HOME}+{END}'" Exit Sub End If End Sub

Private Sub Command2_Click() Unload Me End Sub Private Sub Image2_Click()

End Sub

Private Sub txtnama_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If txtpass.SetFocus End Sub

Private Sub txtpass_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter

Exit Sub End If cmdmasuk.SetFocus End Sub FORM LOADING

KODE PROGRAM Private Sub Form_Load() End Sub Private Sub Timer1_Timer() Label2.Caption = Label2.Caption + 1 ProgressBar1.Value = ProgressBar1.Value + 1 If ProgressBar1.Value = 100 Then

Do Me.Top = Me.Top + 10 Me.Move Me.Left, Me.Top DoEvents Loop Until Me.Top > Screen.Height - 800 Unload Me Form3.Show End If

End Sub

Private Sub Timer2_Timer() Label1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255) End Sub

FORM MENU UTAMA

KODE PROGRAM Private Sub cetak_Click() DataReport1.Show End Sub

Private Sub data_Click() Form5.Show End Sub

Private Sub Form_Load()

End Sub

Private Sub kel_Click() Unload Me

End Sub

Private Sub spt_Click() Form4.Show End Sub

FORM INPUT DATA SPT

KODE PROGRAM

Private Sub Command1_Click() Text1.Locked = False Text2.Locked = False Text3.Locked = False Text4.Locked = False Text5.Locked = False Text6.Locked = False Text7.Locked = False

Text8.Locked = False Text9.Locked = False Text10.Locked = False Text1.SetFocus

End Sub

Private Sub Command2_Click() Dim X As Integer 'Simpan isi form ke record baru On Error GoTo Salah With Adodc1.Recordset .AddNew !nomor = Text1.Text !nip = Text2.Text !nama = Text3.Text !pangkat = Text4.Text !jabatan = Text5.Text !untuk = Text6.Text !pada = Text7.Text !program = Text8.Text !kegiatan = Text9.Text !tanggal = Text10.Text .Update On Error GoTo 0 End With BersihLayar

Exit Sub Salah: X = MsgBox("Ada kesalahan saat menyimpan data!" + Chr(13) + _ "Penyimpanan dibatalkan...", vbOKOnly) End Sub

Private Sub Command3_Click() On Error Resume Next Form4.Adodc1.Recordset.Delete Form4.Adodc1.Refresh Form4.Adodc1.Recordset.Update Form4.Adodc1.Refresh End Sub

Private Sub Command4_Click() BersihLayar End Sub

Private Sub Command5_Click() Unload Me Form3.Show End Sub

Private Sub Command6_Click() Form5.Show End Sub

Private Sub Form_Load() On Error Resume Next Dim lokasie As String With Form4.Adodc1 If Right(App.Path, 1) = "\" Then lokasie = Left(App.Path, Len(App.Path) - 1) Else lokasie = App.Path End If .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & lokasie & "\data.mdb;Persist Security Info=False" .CommandType = adCmdText .RecordSource = "select*from spt" End With End Sub Private Sub BersihLayar() 'Membersihkan Layar Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text9.Text = "" Text10.Text = ""

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If Text2.SetFocus End Sub

Private Sub Text10_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If Command2.SetFocus End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If Text3.SetFocus End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If

Text4.SetFocus End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If Text5.SetFocus End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If Text6.SetFocus End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If Text7.SetFocus End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub

End If Text8.SetFocus End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If Text9.SetFocus End Sub

Private Sub Text9_KeyPress(KeyAscii As Integer) If Not KeyAscii = 13 Then '13 adalah nomor Enter Exit Sub End If Text10.SetFocus End Sub

FORM PENCARIAN

KODE PROGRAM Private Sub Command1_Click() Unload Me Form3.Show End Sub

Private Sub Command2_Click() On Error Resume Next Form5.Adodc1.Recordset.AddNew Form5.Adodc1.Refresh Form5.Adodc1.Recordset.Update Form5.Adodc1.Refresh End Sub

Private Sub Command3_Click() On Error Resume Next Form5.Adodc1.Recordset.AddNew

Form5.Adodc1.Refresh Form5.Adodc1.Recordset.Update Form5.Adodc1.Refresh End Sub

Private Sub Form_Activate() Form5.Adodc1.Refresh Form5.DataGrid1.Refresh End Sub

Private Sub Form_Load() On Error Resume Next Dim lokasie As String With Form5.Adodc1 If Right(App.Path, 1) = "\" Then lokasie = Left(App.Path, Len(App.Path) - 1) Else lokasie = App.Path End If .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & lokasie & "\data.mdb;Persist Security Info=False" .CommandType = adCmdText .RecordSource = "select*from spt" End With End Sub

Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub Text1_Change() On Error Resume Next With Form5.Adodc1 .RecordSource = "select*from spt where nomor like '%" & Form5.Text1.Text & "%'" .Refresh End With End Sub

Private Sub Text2_Change() On Error Resume Next With Form5.Adodc1 .RecordSource = "select*from spt where nip like '%" & Form5.Text2.Text & "%'" .Refresh End With End Sub

Private Sub Text3_Change() On Error Resume Next With Form5.Adodc1 .RecordSource = "select*from spt where nama like '%" & Form5.Text3.Text & "%'" .Refresh End With End Sub

SURAT PERINTAH TUGAS (SPT)

Potrebbero piacerti anche