VERSION 5.00
Begin VB.Form Sekolah 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Sekolah Asal"
   ClientHeight    =   2595
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5430
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   2595
   ScaleWidth      =   5430
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  'DefaultCursor
      DefaultType     =   2  'UseODBC
      Exclusive       =   0   'False
      Height          =   495
      Left            =   5760
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   1140
      Width           =   1140
   End
   Begin VB.Frame Frame2 
      Height          =   735
      Left            =   360
      TabIndex        =   9
      Top             =   1740
      Width           =   4695
      Begin VB.CommandButton Keluar 
         Caption         =   "&Keluar"
         Height          =   495
         Left            =   3420
         TabIndex        =   6
         Top             =   180
         Width           =   1095
      End
      Begin VB.CommandButton Hapus 
         Caption         =   "&Hapus"
         Height          =   495
         Left            =   2340
         TabIndex        =   5
         Top             =   180
         Width           =   1095
      End
      Begin VB.CommandButton Koreksi 
         Caption         =   "&Koreksi"
         Height          =   495
         Left            =   1260
         TabIndex        =   4
         Top             =   180
         Width           =   1095
      End
      Begin VB.CommandButton simpan 
         Caption         =   "&Simpan"
         Height          =   495
         Left            =   180
         TabIndex        =   3
         Top             =   180
         Width           =   1095
      End
   End
   Begin VB.Frame Frame1 
      Height          =   1335
      Left            =   360
      TabIndex        =   0
      Top             =   300
      Width           =   4695
      Begin VB.TextBox nama 
         Height          =   315
         Left            =   1560
         TabIndex        =   1
         Text            =   " "
         Top             =   240
         Width           =   2895
      End
      Begin VB.TextBox rayo 
         Height          =   315
         Left            =   1560
         TabIndex        =   2
         Text            =   " "
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "Rayon"
         Height          =   315
         Left            =   240
         TabIndex        =   8
         Top             =   780
         Width           =   1275
      End
      Begin VB.Label Label1 
         Caption         =   "Nama Sekolah"
         Height          =   315
         Left            =   240
         TabIndex        =   7
         Top             =   300
         Width           =   1275
      End
   End
End
Attribute VB_Name = "Sekolah"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public dbRayon As Database
Public rsRayon As Recordset
Private Sub hapus_Click()
rsRayon.Delete
Call bersih
End Sub
Private Sub keluar_Click()
Unload Me
End Sub

Private Sub koreksi_Click()
 rsRayon.edit
 rsRayon(1) = rayo.Text
 rsRayon(0) = nama.Text
  rsRayon.Update
  Call bersih
End Sub

Private Sub simpan_Click()
 rsRayon.AddNew
 rsRayon(1) = rayo.Text
 rsRayon(0) = nama.Text
 rsRayon.Update
 Call bersih
 End Sub
Private Sub bersih()
nama.Text = ""
rayo.Text = ""
nama.SetFocus
End Sub
Private Sub Form_Load()
Set dbRayon = OpenDatabase(App.Path & "\Siswa baru.mdb")
Set rsRayon = dbRayon.OpenRecordset("Rayon")
rsRayon.Index = "cari"
nama = ""
End Sub
Private Sub nama_Change()

    rsRayon.Seek "=", nama.Text
    If rsRayon.NoMatch Then
    simpan.Enabled = True
    Hapus.Enabled = False
    Koreksi.Enabled = False
    ElseIf Not rsRayon.NoMatch Then
    rayo.Text = rsRayon(1)
      simpan.Enabled = False
    Hapus.Enabled = True
    Koreksi.Enabled = True
End If
End Sub




