VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmUser 
   Caption         =   "Username All"
   ClientHeight    =   6435
   ClientLeft      =   120
   ClientTop       =   465
   ClientWidth     =   9705
   LinkTopic       =   "Form1"
   ScaleHeight     =   6435
   ScaleWidth      =   9705
   StartUpPosition =   3  'Windows Default
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   2700
      Left            =   120
      TabIndex        =   6
      Top             =   480
      Width           =   7545
      _ExtentX        =   13309
      _ExtentY        =   4763
      _Version        =   393216
      AllowUpdate     =   0   'False
      AllowArrows     =   -1  'True
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   222
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   222
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "ÃËÑÊ¼Ùéãªé"
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1054
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1054
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   1
      Left            =   3840
      Top             =   5040
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   2880
      TabIndex        =   5
      Text            =   "Text2"
      Top             =   5280
      Width           =   735
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   1680
      TabIndex        =   4
      Text            =   "Text1"
      Top             =   5280
      Width           =   855
   End
   Begin VB.CommandButton Command4 
      Caption         =   "ÍÍ¡"
      Height          =   495
      Left            =   5640
      TabIndex        =   3
      Top             =   3240
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Åº"
      Height          =   495
      Left            =   4440
      TabIndex        =   2
      Top             =   3240
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "á¡éä¢"
      Height          =   495
      Left            =   3120
      TabIndex        =   1
      Top             =   3240
      Width           =   1095
   End
   Begin VB.CommandButton cmdadd 
      Caption         =   "à¾ÔèÁ¼Ùéãªé"
      Height          =   495
      Left            =   1080
      TabIndex        =   0
      Top             =   3240
      Width           =   1695
   End
End
Attribute VB_Name = "frmUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim glbPosition As String
Dim ctr As Integer
Dim Cancel As Integer

Private Sub cmdadd_Click()
Text2.Text = ""
frmInputUser.Show vbModal
End Sub

Private Sub Command2_Click()
Text2.Text = Text1.Text
frmInputUser.cmdsave.Caption = "&Update"
frmInputUser.Show vbModal
End Sub


Private Sub Command3_Click()
Dim repp As Integer
repp = MsgBox("Do you want to delete.  Press 'Yes' to exit or Press 'No' to continue deletings.?", vbExclamation + vbYesNo)
If repp = vbNo Then
    Cancel = 1
End If
If repp = vbYes Then
    Set rs = New ADODB.Recordset
    rs.Open "Delete from [tbl_product] where [BarcodeNo]=" & Text1.Text & "", conn, 3, 3
    Timer1.Enabled = True
    MsgBox "User is successfully delete.", vbInformation
    Set rs = Nothing
End If
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Form_Load()
Call Dbase
Set rs_product = New ADODB.Recordset
rs_product.Open "Select [BarcodeNo],[ProductName],[CategoryName],[price] ,[Quantity] from [tbl_product] order by [BarcodeNo] asc ", conn, 3, 3
Set DataGrid1.DataSource = rs_product
'DataGrid1.Columns(0).Width = 1500
'DataGrid1.Columns(1).Width = 4200
Set Text1.DataSource = rs_product
Text1.DataField = "BarcodeNo"

End Sub


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Set rs_product = Nothing
End Sub


Private Sub Timer1_Timer()
Form_Load
Timer1.Enabled = False
End Sub



