VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frmFilm 
   Caption         =   ". . : :  F I L M    : : . ."
   ClientHeight    =   3900
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4995
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3900
   ScaleWidth      =   4995
   Begin TabDlg.SSTab SSTabFilm 
      Height          =   3375
      Left            =   120
      TabIndex        =   0
      Top             =   480
      Width           =   4815
      _ExtentX        =   8493
      _ExtentY        =   5953
      _Version        =   393216
      Tabs            =   2
      TabHeight       =   520
      TabCaption(0)   =   "TAMBAH"
      Tab(0).ControlEnabled=   -1  'True
      Tab(0).Control(0)=   "Label7"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "Label1"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "Label2"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).Control(3)=   "Label4"
      Tab(0).Control(3).Enabled=   0   'False
      Tab(0).Control(4)=   "cmdTambahNew"
      Tab(0).Control(4).Enabled=   0   'False
      Tab(0).Control(5)=   "txtTambahStock"
      Tab(0).Control(5).Enabled=   0   'False
      Tab(0).Control(6)=   "txtTambahJudul"
      Tab(0).Control(6).Enabled=   0   'False
      Tab(0).Control(7)=   "txtTambahFilm"
      Tab(0).Control(7).Enabled=   0   'False
      Tab(0).Control(8)=   "txtTambahGenre"
      Tab(0).Control(8).Enabled=   0   'False
      Tab(0).Control(9)=   "cmdTambahSave"
      Tab(0).Control(9).Enabled=   0   'False
      Tab(0).Control(10)=   "cmdTambahCancel"
      Tab(0).Control(10).Enabled=   0   'False
      Tab(0).ControlCount=   11
      TabCaption(1)   =   "EDIT"
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "cmdEditDelete"
      Tab(1).Control(0).Enabled=   0   'False
      Tab(1).Control(1)=   "cmdEditSave"
      Tab(1).Control(1).Enabled=   0   'False
      Tab(1).Control(2)=   "txtEditGenre"
      Tab(1).Control(2).Enabled=   0   'False
      Tab(1).Control(3)=   "txtEditFilm"
      Tab(1).Control(3).Enabled=   0   'False
      Tab(1).Control(4)=   "txtEditJudul"
      Tab(1).Control(4).Enabled=   0   'False
      Tab(1).Control(5)=   "txtEditStock"
      Tab(1).Control(5).Enabled=   0   'False
      Tab(1).Control(6)=   "cmdEditView"
      Tab(1).Control(6).Enabled=   0   'False
      Tab(1).Control(7)=   "Label3"
      Tab(1).Control(7).Enabled=   0   'False
      Tab(1).Control(8)=   "Label5"
      Tab(1).Control(8).Enabled=   0   'False
      Tab(1).Control(9)=   "Label6"
      Tab(1).Control(9).Enabled=   0   'False
      Tab(1).Control(10)=   "Label8"
      Tab(1).Control(10).Enabled=   0   'False
      Tab(1).ControlCount=   11
      Begin VB.CommandButton cmdTambahCancel 
         Caption         =   "&Cancel"
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   3240
         TabIndex        =   7
         Top             =   2640
         Width           =   1215
      End
      Begin VB.CommandButton cmdTambahSave 
         Caption         =   "&Save"
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   1800
         TabIndex        =   6
         Top             =   2640
         Width           =   1215
      End
      Begin VB.TextBox txtTambahGenre 
         Enabled         =   0   'False
         Height          =   375
         Left            =   1920
         TabIndex        =   2
         Top             =   1080
         Width           =   2775
      End
      Begin VB.TextBox txtTambahFilm 
         Height          =   375
         Left            =   1920
         Locked          =   -1  'True
         TabIndex        =   1
         Top             =   600
         Width           =   2775
      End
      Begin VB.CommandButton cmdEditDelete 
         Caption         =   "&Delete"
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   -73200
         TabIndex        =   13
         Top             =   2640
         Width           =   1215
      End
      Begin VB.CommandButton cmdEditSave 
         Caption         =   "&Save"
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   -74760
         TabIndex        =   12
         Top             =   2640
         Width           =   1215
      End
      Begin VB.TextBox txtEditGenre 
         Enabled         =   0   'False
         Height          =   375
         Left            =   -73080
         TabIndex        =   9
         Top             =   1080
         Width           =   2775
      End
      Begin VB.TextBox txtEditFilm 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   -73080
         Locked          =   -1  'True
         TabIndex        =   8
         Top             =   600
         Width           =   2775
      End
      Begin VB.TextBox txtTambahJudul 
         Enabled         =   0   'False
         Height          =   375
         Left            =   1920
         TabIndex        =   3
         Top             =   1560
         Width           =   2775
      End
      Begin VB.TextBox txtTambahStock 
         Enabled         =   0   'False
         Height          =   375
         Left            =   1920
         TabIndex        =   4
         Top             =   2040
         Width           =   2775
      End
      Begin VB.TextBox txtEditJudul 
         Enabled         =   0   'False
         Height          =   375
         Left            =   -73080
         TabIndex        =   10
         Top             =   1560
         Width           =   2775
      End
      Begin VB.TextBox txtEditStock 
         Enabled         =   0   'False
         Height          =   375
         Left            =   -73080
         TabIndex        =   11
         Top             =   2040
         Width           =   2775
      End
      Begin VB.CommandButton cmdEditView 
         Caption         =   "&View"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   -71760
         TabIndex        =   14
         Top             =   2640
         Width           =   1215
      End
      Begin VB.CommandButton cmdTambahNew 
         Caption         =   "&New"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   240
         TabIndex        =   5
         Top             =   2640
         Width           =   1215
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "Judul"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   240
         TabIndex        =   22
         Top             =   1560
         Width           =   660
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "Genre"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   240
         TabIndex        =   21
         Top             =   1080
         Width           =   765
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "ID Film"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   240
         TabIndex        =   20
         Top             =   600
         Width           =   870
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "Judul"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   -74760
         TabIndex        =   19
         Top             =   1560
         Width           =   660
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "Genre"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   -74760
         TabIndex        =   18
         Top             =   1080
         Width           =   765
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "ID Film"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   -74760
         TabIndex        =   17
         Top             =   600
         Width           =   870
      End
      Begin VB.Label Label7 
         Caption         =   "Stock"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   16
         Top             =   2040
         Width           =   1095
      End
      Begin VB.Label Label8 
         Caption         =   "Stock"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   -74760
         TabIndex        =   15
         Top             =   2040
         Width           =   1335
      End
   End
   Begin VB.Label Label9 
      Alignment       =   2  'Center
      Caption         =   "DATA FILM"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   0
      TabIndex        =   23
      Top             =   0
      Width           =   5055
   End
End
Attribute VB_Name = "frmFilm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim oldsize As Long
   
Private Sub Form_Resize()
    If Me.Width = oldsize Then
        Exit Sub
    Else
        CenterC Me
        oldsize = Me.Width
    End If
    If Me.Width <> 5145 Then Me.Width = 5145
    If Me.Height <> 4455 Then Me.Height = 4455
End Sub

Sub aktiftambah()
    txtTambahGenre.Enabled = Not txtTambahGenre.Enabled
    txtTambahJudul.Enabled = Not txtTambahJudul.Enabled
    txtTambahStock.Enabled = Not txtTambahStock.Enabled
    cmdTambahCancel.Enabled = Not cmdTambahCancel.Enabled
    cmdTambahSave.Enabled = Not cmdTambahSave.Enabled
    cmdTambahNew.Enabled = Not cmdTambahNew.Enabled
End Sub

Sub aktifedit()
    txtEditGenre.Enabled = Not txtEditGenre.Enabled
    txtEditJudul.Enabled = Not txtEditJudul.Enabled
    txtEditStock.Enabled = Not txtEditStock.Enabled
    cmdEditDelete.Enabled = Not cmdEditDelete.Enabled
    cmdEditSave.Enabled = Not cmdEditSave.Enabled
    cmdEditView.Enabled = Not cmdEditView.Enabled
End Sub

Private Sub cmdTambahCancel_Click()
    txtTambahFilm = ""
    txtTambahJudul = ""
    txtTambahGenre = ""
    txtTambahStock = ""
    aktiftambah
End Sub

Private Sub cmdEditDelete_Click()
    aktifedit
    conn.Execute "delete * from T_Film where [Id Film]='" & txtEditFilm & "'"
    txtEditFilm = ""
    txtEditJudul = ""
    txtEditGenre = ""
    txtEditStock = ""
End Sub

Private Sub cmdEditSave_Click()
    aktifedit
    If txtEditFilm = "" And txtEditGenre = "" And txtEditJudul = "" And txtEditStock = "" Then
    
    Else
        conn.Execute "Update T_Film set [Id Film]='" & txtEditFilm & "',[Genre]='" & txtEditGenre & "',[Judul]='" & txtEditJudul & "',[Stock]='" & txtEditStock & "' where [Id Film]= '" & txtEditFilm & "'"
        txtEditFilm = ""
        txtEditGenre = ""
        txtEditJudul = ""
        txtEditStock = ""
    End If
End Sub

Private Sub cmdTambahSave_Click()
    conn.Execute "insert into T_Film values('" & txtTambahFilm & "','" & txtTambahGenre & "','" & txtTambahJudul & "','" & txtTambahStock & "')"
    txtTambahFilm = ""
    txtTambahGenre = ""
    txtTambahJudul = ""
    txtTambahStock = ""
    aktiftambah
End Sub

Private Sub cmdTambahNew_Click()
Dim no
    aktiftambah
    If rec.State = 1 Then rec.Close
    rec.Open "select [Id Film] from T_Film", conn, 3, 3
    If Not rec.EOF Then
        rec.MoveLast
        no = Val(Right(rec("Id Film"), 3)) + 1
        no = "F" & String(3 - Len(no), "0") & no
    Else
        no = "F001"
    End If
    txtTambahFilm = no
    txtTambahGenre.SetFocus
End Sub

Private Sub cmdEditView_Click()
    frmDataFilm.Show 1
    aktifedit
End Sub

Private Sub Form_Load()
    txtEditFilm = ""
    txtEditGenre = ""
    txtEditJudul = ""
    txtEditStock = ""
    Me.Height = 4410
    Me.Width = 5220
    CenterC Me
    oldsize = Me.Width
End Sub

Private Sub SSTabFilm_Click(PreviousTab As Integer)
    If SSTabFilm.Caption = "TAMBAH" Then
        txtEditFilm = ""
        txtEditGenre = ""
        txtEditJudul = ""
        txtEditStock = ""
        If txtEditGenre.Enabled = True Then aktifedit
    ElseIf SSTabFilm.Caption = "EDIT" Then
        txtTambahFilm = ""
        txtTambahGenre = ""
        txtTambahJudul = ""
        txtTambahStock = ""
        If txtTambahGenre.Enabled = True Then aktiftambah
    End If
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendKeys ("{TAB}")
        KeyAscii = 0
    End If
End Sub

Private Sub txtEditStock_Change()
    If IsNumeric(txtEditStock) = False Then
        txtEditStock = ""
        
    End If
End Sub

Private Sub txtTambahStock_Change()
    If IsNumeric(txtTambahStock) = False Then
        txtTambahStock = ""
        
    End If
End Sub

Private Sub txtTambahStock_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        cmdTambahSave.Value = True
    End If
End Sub

Private Sub txtEditStock_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        cmdEditSave.Value = True
    End If
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim cepat As Long
    cepat = 1000
    While Left + Width < Screen.Width
        DoEvents
        Left = Left + cepat
    Wend
    While Top - Height < Screen.Height
        DoEvents
        Top = Top + cepat
    Wend
    Unload Me
End Sub


