Reset kembali - pencarian dari awal nLastRow = 0
End If Set Focus
If .TopRow + 10 nLastRow Then .TopRow = nLastRow End With
End Sub Private Sub cmdCloseHelp_Click
picHelp.Visible = False End Sub
Private Sub cmdHelp_Click picHelp.Visible = True
picHelp.ZOrder 0 cmdCloseHelp.SetFocus
End Sub Private Sub Form_KeyDownKeyCode As Integer, Shift As
Integer If KeyCode = vbKeyReturn Then
Untuk Enter SendKeys {TAB}
Else Select Case KeyCode
Case vbKeyF1: Call ProsesHELP Case vbKeyF2: Call ProsesBARU
Case vbKeyF3: Call ProsesSIMPAN Case vbKeyF4: Call ProsesHAPUS
Case vbKeyF5: Call ProsesREFRESH Case vbKeyF6: Call ProsesFIRST
Case vbKeyF7: Call ProsesPREVIOUS Case vbKeyF8: Call ProsesNEXT
Case vbKeyF9: Call ProsesLAST Case vbKeyF10: Call ProsesKELUAR
Case vbKeyF12: Call ProsesPRINT End Select
End If End Sub
errDel: oConn.RollbackTrans
MsgBox Proses hapus data gagal vbCrLf Err.Description, vbCritical, Error
End Sub
3. Form Master Supplier frmSupplier.frm
Option Explicit Private nLastRow As Integer
Private Sub cmdCari_Click If TrimtxtKunci.Text = Then Exit Sub
Universitas Sumatera Utara
Dim I As Long Dim J As Integer
Dim nSearchCol As Integer Ambil kolom yang dicari
nSearchCol = cboKategori.ListIndex + 1 With MData
If nLastRow 0 Then Background Putih
For I = 1 To .Cols - 1 .Col = I
.Row = nLastRow .CellBackColor = HFFFFFF
Next I End If
Cari Text For I = nLastRow + 1 To .Rows - 1
If InStr1, UCase.TextMatrixI, nSearchCol, _ UCasetxtKunci.Text 0 Then
nLastRow = I Warnai dengan background kuning
.Row = I For J = 1 To .Cols - 1
.Col = J .CellBackColor = H87F2F0
Next J Exit For
End If Next I
If I = .Rows Then Reset kembali - pencarian dari awal
nLastRow = 0 End If
Set Focus If .TopRow + 10 nLastRow Then .TopRow = nLastRow
End With End Sub
Private Sub txtNoTelp_KeyPressKeyAscii As Integer If KeyAscii vbKeyBack And KeyAscii Asc0 Or
KeyAscii Asc9 _ And InStr1, -,, ChrKeyAscii = 0 Then
KeyAscii = 0 End If
End Sub Private Sub txtNoHP_KeyPressKeyAscii As Integer
Universitas Sumatera Utara
If KeyAscii vbKeyBack And KeyAscii Asc0 Or KeyAscii Asc9 _
And InStr1, -,, ChrKeyAscii = 0 Then KeyAscii = 0
End If End Sub
4. Form Master Customer frmCustomer.frm
Option Explicit Private nLastRow As Integer
Private Sub cmdCari_Click If TrimtxtKunci.Text = Then Exit Sub
Dim I As Long Dim J As Integer
Dim nSearchCol As Integer Ambil kolom yang dicari
nSearchCol = cboKategori.ListIndex + 1 With MData
If nLastRow 0 Then Background Putih
For I = 1 To .Cols - 1 .Col = I
.Row = nLastRow .CellBackColor = HFFFFFF
Next I End If
Cari Text For I = nLastRow + 1 To .Rows - 1
If InStr1, UCase.TextMatrixI, nSearchCol, _ UCasetxtKunci.Text 0 Then
nLastRow = I Warnai dengan background kuning
.Row = I For J = 1 To .Cols - 1
.Col = J .CellBackColor = H87F2F0
Next J Exit For
End If Next I
If I = .Rows Then Reset kembali - pencarian dari awal
nLastRow = 0 End If
Set Focus
Universitas Sumatera Utara
If .TopRow + 10 nLastRow Then .TopRow = nLastRow End With
End Sub Private Sub cmdCloseHelp_Click
picHelp.Visible = False End Sub
Private Sub cmdHelp_Click picHelp.Visible = True
picHelp.ZOrder 0 cmdCloseHelp.SetFocus
End Sub Private Sub txtNoHP_KeyPressKeyAscii As Integer
If KeyAscii vbKeyBack And KeyAscii Asc0 Or KeyAscii Asc9 _
And InStr1, -,, ChrKeyAscii = 0 Then KeyAscii = 0
End If End Sub
5. Form Transaksi Pembelian frmBeli.frm