VERSION 5.00
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Begin VB.Form Quot_Line_Mtnc 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Product line maintenance"
   ClientHeight    =   8130
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   11910
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   8130
   ScaleWidth      =   11910
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton ssc_quit 
      Height          =   615
      Left            =   11160
      Style           =   1  'Graphical
      TabIndex        =   63
      Top             =   7380
      Width           =   615
   End
   Begin VB.CommandButton SSC_save 
      Height          =   615
      Left            =   10440
      Style           =   1  'Graphical
      TabIndex        =   62
      Top             =   7380
      Width           =   615
   End
   Begin VB.Frame Frm_Common 
      Height          =   2295
      Left            =   120
      TabIndex        =   37
      Top             =   0
      Width           =   11655
      Begin Project1.CDate txt_PlannedProduction 
         Height          =   315
         Left            =   7440
         TabIndex        =   131
         Top             =   1860
         Width           =   1815
         _extentx        =   3201
         _extenty        =   556
      End
      Begin Project1.CDate txt_promisedShipping 
         Height          =   315
         Left            =   7440
         TabIndex        =   130
         Top             =   1500
         Width           =   1815
         _extentx        =   3201
         _extenty        =   556
      End
      Begin VB.CheckBox chk_OrderConfirmation 
         Caption         =   "Check1"
         Height          =   195
         Left            =   9540
         TabIndex        =   10
         Top             =   1920
         Visible         =   0   'False
         Width           =   195
      End
      Begin VB.Frame frm_PlantConfirmation 
         Caption         =   "Plant confirmation"
         Height          =   1035
         Left            =   9480
         TabIndex        =   124
         Top             =   720
         Visible         =   0   'False
         Width           =   1995
         Begin VB.OptionButton opt_PlantNo 
            Caption         =   "Refused"
            Height          =   315
            Left            =   180
            TabIndex        =   9
            Top             =   600
            Width           =   1635
         End
         Begin VB.OptionButton opt_PlantYes 
            Caption         =   "Confimed"
            Height          =   255
            Left            =   180
            TabIndex        =   8
            Top             =   300
            Width           =   1695
         End
      End
      Begin VB.TextBox txt_Quantity 
         BeginProperty DataFormat 
            Type            =   0
            Format          =   "0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
         Height          =   285
         Left            =   1980
         TabIndex        =   2
         Top             =   1080
         Width           =   1095
      End
      Begin VB.TextBox txt_stdPrice 
         Height          =   315
         Left            =   1980
         TabIndex        =   4
         Top             =   1800
         Width           =   1095
      End
      Begin VB.TextBox txt_Price 
         Height          =   285
         Left            =   1980
         TabIndex        =   3
         Top             =   1440
         Width           =   1095
      End
      Begin VB.TextBox txt_Amount 
         Height          =   285
         Left            =   3240
         TabIndex        =   5
         Top             =   900
         Visible         =   0   'False
         Width           =   1095
      End
      Begin VB.TextBox txt_LeadTime 
         Height          =   315
         Left            =   7440
         TabIndex        =   7
         Top             =   1140
         Width           =   1575
      End
      Begin VB.TextBox txt_LineDesc 
         Height          =   285
         Left            =   1980
         MaxLength       =   140
         TabIndex        =   0
         Top             =   300
         Width           =   9255
      End
      Begin MSForms.ComboBox cbo_currency 
         Height          =   315
         Left            =   3120
         TabIndex        =   91
         Top             =   1800
         Width           =   1995
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3519;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_Plant 
         Height          =   315
         Left            =   6660
         TabIndex        =   6
         Top             =   720
         Width           =   2595
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4577;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_unitOfMesure 
         Height          =   315
         Left            =   1980
         TabIndex        =   1
         Top             =   720
         Width           =   3135
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "5530;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_OrderConfirmation 
         Caption         =   "Scheduled in plant"
         Height          =   255
         Left            =   9840
         TabIndex        =   126
         Top             =   1920
         Visible         =   0   'False
         Width           =   1695
      End
      Begin VB.Label lbl_Plant 
         Caption         =   "Plant"
         Height          =   255
         Left            =   5400
         TabIndex        =   125
         Top             =   720
         Width           =   915
      End
      Begin VB.Label lbl_leadTime 
         Caption         =   "Lead time"
         Height          =   255
         Left            =   5400
         TabIndex        =   74
         Top             =   1140
         Width           =   1815
      End
      Begin VB.Label lbl_promisedShipping 
         Caption         =   "Promised shipping"
         Height          =   255
         Left            =   5400
         TabIndex        =   73
         Top             =   1500
         Width           =   1815
      End
      Begin VB.Label lbl_plannedProduction 
         Caption         =   "Planned production"
         Height          =   255
         Left            =   5400
         TabIndex        =   72
         Top             =   1860
         Width           =   1815
      End
      Begin VB.Label lbl_LineDesc 
         Caption         =   "Description"
         Height          =   375
         Left            =   240
         TabIndex        =   69
         Top             =   300
         Width           =   1815
      End
      Begin VB.Label lbl_Amount 
         Caption         =   "Amount"
         Height          =   375
         Left            =   4380
         TabIndex        =   68
         Top             =   960
         Visible         =   0   'False
         Width           =   1815
      End
      Begin VB.Label lbl_Price 
         Caption         =   "Price"
         Height          =   375
         Left            =   240
         TabIndex        =   67
         Top             =   1440
         Width           =   1815
      End
      Begin VB.Label lbl_StdPrice 
         Caption         =   "Standard price"
         Height          =   255
         Left            =   240
         TabIndex        =   66
         Top             =   1800
         Width           =   1815
      End
      Begin VB.Label Lbl_Quantity 
         Caption         =   "Quantity"
         Height          =   375
         Left            =   240
         TabIndex        =   65
         Top             =   1080
         Width           =   1815
      End
      Begin VB.Label Lbl_UnitOfMesure 
         Caption         =   "Unit of measure"
         Height          =   375
         Left            =   240
         TabIndex        =   64
         Top             =   720
         Width           =   1815
      End
   End
   Begin VB.Frame frm_MetalProduct 
      Height          =   4875
      Left            =   120
      TabIndex        =   99
      Top             =   2400
      Visible         =   0   'False
      Width           =   11655
      Begin VB.TextBox txt_BISAPCode 
         Height          =   315
         Left            =   5340
         TabIndex        =   38
         Top             =   240
         Width           =   2835
      End
      Begin VB.TextBox txt_AcousticSetUp 
         Height          =   285
         Left            =   9720
         TabIndex        =   56
         Top             =   3180
         Width           =   1815
      End
      Begin VB.TextBox txt_AcousticCost 
         Height          =   285
         Left            =   9720
         TabIndex        =   55
         Top             =   2760
         Width           =   1815
      End
      Begin VB.TextBox txt_DetailSetUp 
         Height          =   285
         Left            =   5700
         TabIndex        =   54
         Top             =   3180
         Width           =   1815
      End
      Begin VB.TextBox txt_DetailCost 
         Height          =   285
         Left            =   5700
         TabIndex        =   53
         Top             =   2760
         Width           =   1815
      End
      Begin VB.TextBox txt_TileSetUp 
         Height          =   285
         Left            =   1860
         TabIndex        =   52
         Top             =   3180
         Width           =   1815
      End
      Begin VB.TextBox txt_TileCost 
         Height          =   285
         Left            =   1860
         TabIndex        =   51
         Top             =   2760
         Width           =   1815
      End
      Begin VB.TextBox txt_SurfacePerPiece 
         Height          =   285
         Left            =   1860
         TabIndex        =   57
         Top             =   3780
         Width           =   1815
      End
      Begin VB.TextBox txt_CartonPerPallet 
         Height          =   285
         Left            =   9720
         TabIndex        =   61
         Top             =   3780
         Width           =   1815
      End
      Begin VB.TextBox txt_CartonWeight 
         Height          =   285
         Left            =   5700
         TabIndex        =   60
         Top             =   4200
         Width           =   1815
      End
      Begin VB.TextBox txt_SurfacePerCarton 
         Height          =   285
         Left            =   5700
         TabIndex        =   59
         Top             =   3780
         Width           =   1815
      End
      Begin VB.TextBox txt_PiecePerCtn 
         Height          =   285
         Left            =   1860
         TabIndex        =   58
         Top             =   4200
         Width           =   1815
      End
      Begin VB.TextBox txt_FaceSize 
         Height          =   285
         Left            =   1860
         TabIndex        =   41
         Top             =   1680
         Width           =   1815
      End
      Begin VB.TextBox txt_Panel 
         Height          =   285
         Left            =   1860
         TabIndex        =   40
         Top             =   1260
         Width           =   1815
      End
      Begin MSForms.ComboBox cbo_AcousticInFill 
         Height          =   315
         Left            =   9720
         TabIndex        =   133
         Top             =   4140
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   0
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_AcousticInFill 
         Caption         =   "Acoustic infill"
         Height          =   315
         Left            =   7740
         TabIndex        =   132
         Top             =   4200
         Width           =   1635
      End
      Begin MSForms.ComboBox cbo_Finish 
         Height          =   315
         Left            =   5700
         TabIndex        =   46
         Top             =   2100
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_System 
         Height          =   315
         Left            =   1860
         TabIndex        =   39
         Top             =   840
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_EdgeLeft 
         Height          =   315
         Left            =   9720
         TabIndex        =   47
         Top             =   840
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_Material 
         Height          =   315
         Left            =   5700
         TabIndex        =   43
         Top             =   840
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_Gasket 
         Height          =   315
         Left            =   1860
         TabIndex        =   42
         Top             =   2100
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_EdgeRight 
         Height          =   315
         Left            =   9720
         TabIndex        =   48
         Top             =   1260
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_EdgeTop 
         Height          =   315
         Left            =   9720
         TabIndex        =   49
         Top             =   1680
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_EdgeBottom 
         Height          =   315
         Left            =   9720
         TabIndex        =   50
         Top             =   2100
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_Perforation 
         Height          =   315
         Left            =   5700
         TabIndex        =   44
         Top             =   1260
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_Border 
         Height          =   315
         Left            =   5700
         TabIndex        =   45
         Top             =   1680
         Width           =   1815
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3201;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_System 
         Caption         =   "System"
         Height          =   315
         Left            =   180
         TabIndex        =   123
         Top             =   840
         Width           =   1635
      End
      Begin VB.Label lbl_Border 
         Caption         =   "Plain borders"
         Height          =   315
         Left            =   3900
         TabIndex        =   122
         Top             =   1680
         Width           =   1635
      End
      Begin VB.Label lbl_Perforation 
         Caption         =   "Perforation pattern"
         Height          =   315
         Left            =   3900
         TabIndex        =   121
         Top             =   1260
         Width           =   1635
      End
      Begin VB.Label lbl_Finish 
         Caption         =   "Finish"
         Height          =   315
         Left            =   3900
         TabIndex        =   120
         Top             =   2100
         Width           =   1635
      End
      Begin VB.Label lbl_Material 
         Caption         =   "Material"
         Height          =   315
         Left            =   3900
         TabIndex        =   119
         Top             =   840
         Width           =   1635
      End
      Begin VB.Label lbl_Gasket 
         Caption         =   "Gasket on sides"
         Height          =   315
         Left            =   180
         TabIndex        =   118
         Top             =   2100
         Width           =   1635
      End
      Begin VB.Label lbl_EdgeBottom 
         Caption         =   "Edge detail - Bottom Side"
         Height          =   315
         Left            =   7740
         TabIndex        =   117
         Top             =   2100
         Width           =   1935
      End
      Begin VB.Label lbl_EdgeTop 
         Caption         =   "Edge detail - Top Side"
         Height          =   315
         Left            =   7740
         TabIndex        =   116
         Top             =   1680
         Width           =   1635
      End
      Begin VB.Label lbl_EdgeRight 
         Caption         =   "Edge detail - Right Side"
         Height          =   315
         Left            =   7740
         TabIndex        =   115
         Top             =   1260
         Width           =   1755
      End
      Begin VB.Label lbl_EdgeLeft 
         Caption         =   "Edge detail - Left Side"
         Height          =   315
         Left            =   7740
         TabIndex        =   114
         Top             =   840
         Width           =   1635
      End
      Begin VB.Label lbl_FaceSize 
         Caption         =   "Actual face size (A*B)"
         Height          =   315
         Left            =   180
         TabIndex        =   113
         Top             =   1680
         Width           =   1635
      End
      Begin VB.Label lbl_PanelModule 
         Caption         =   "Panel module"
         Height          =   315
         Left            =   180
         TabIndex        =   112
         Top             =   1260
         Width           =   1635
      End
      Begin VB.Label lbl_BISAPCode 
         Caption         =   "CLS item number"
         Height          =   315
         Left            =   3720
         TabIndex        =   111
         Top             =   240
         Width           =   1635
      End
      Begin VB.Label lbl_CartonPerPallet 
         Caption         =   "Cartons per pallet"
         Height          =   315
         Left            =   7740
         TabIndex        =   110
         Top             =   3780
         Width           =   1635
      End
      Begin VB.Label lbl_CartonWeight 
         Caption         =   "Carton weight"
         Height          =   315
         Left            =   3900
         TabIndex        =   109
         Top             =   4200
         Width           =   1635
      End
      Begin VB.Label lbl_SurfacePerCarton 
         Caption         =   "Surface per carton"
         Height          =   315
         Left            =   3900
         TabIndex        =   108
         Top             =   3780
         Width           =   1635
      End
      Begin VB.Label lbl_PiecePerCtn 
         Caption         =   "Piece per carton"
         Height          =   315
         Left            =   180
         TabIndex        =   107
         Top             =   4200
         Width           =   1635
      End
      Begin VB.Label lbl_SurfacePerPiece 
         Caption         =   "Surface per piece"
         Height          =   315
         Left            =   180
         TabIndex        =   106
         Top             =   3780
         Width           =   1635
      End
      Begin VB.Label lbl_AcousticSetUp 
         Caption         =   "Acoustic infill Set-Up"
         Height          =   315
         Left            =   7740
         TabIndex        =   105
         Top             =   3180
         Width           =   1635
      End
      Begin VB.Label lbl_AcousticCost 
         Caption         =   "Acoustic infill cost"
         Height          =   315
         Left            =   7740
         TabIndex        =   104
         Top             =   2760
         Width           =   1635
      End
      Begin VB.Label lbl_DetailSetUp 
         Caption         =   "Special detail Set-Up"
         Height          =   315
         Left            =   3900
         TabIndex        =   103
         Top             =   3180
         Width           =   1635
      End
      Begin VB.Label lbl_DetailCost 
         Caption         =   "Special detail cost"
         Height          =   315
         Left            =   3900
         TabIndex        =   102
         Top             =   2760
         Width           =   1635
      End
      Begin VB.Label lbl_TileSetUp 
         Caption         =   "Tile Set-Up"
         Height          =   315
         Left            =   180
         TabIndex        =   101
         Top             =   3180
         Width           =   1635
      End
      Begin VB.Label lbl_TileCost 
         Caption         =   "Tile cost"
         Height          =   315
         Left            =   180
         TabIndex        =   100
         Top             =   2760
         Width           =   1635
      End
   End
   Begin VB.Frame Frm_BaseItem 
      Height          =   1695
      Left            =   120
      TabIndex        =   70
      Top             =   2400
      Visible         =   0   'False
      Width           =   11655
      Begin VB.PictureBox pic_SAPSearch 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   315
         Left            =   7740
         Picture         =   "Q_Line_Mtnc.frx":0000
         ScaleHeight     =   315
         ScaleWidth      =   255
         TabIndex        =   15
         Top             =   780
         Width           =   252
      End
      Begin VB.TextBox txt_SapCode 
         Height          =   315
         Left            =   4980
         TabIndex        =   14
         Top             =   780
         Width           =   2785
      End
      Begin VB.Label lbl_SAPCode 
         Caption         =   "CLS Item number"
         Height          =   255
         Left            =   3240
         TabIndex        =   71
         Top             =   840
         Width           =   1695
      End
   End
   Begin VB.Frame frm_Comment 
      Height          =   4635
      Left            =   120
      TabIndex        =   75
      Top             =   2460
      Visible         =   0   'False
      Width           =   11655
      Begin VB.TextBox txt_comment 
         Height          =   1755
         Left            =   360
         MaxLength       =   254
         MultiLine       =   -1  'True
         TabIndex        =   12
         Top             =   1140
         Width           =   10455
      End
      Begin VB.CheckBox chk_printed 
         Height          =   375
         Left            =   1440
         TabIndex        =   13
         Top             =   4020
         Value           =   1  'Checked
         Width           =   315
      End
      Begin MSForms.ComboBox cbo_comment 
         Height          =   315
         Left            =   1860
         TabIndex        =   11
         Top             =   360
         Width           =   3675
         VariousPropertyBits=   679495707
         DisplayStyle    =   7
         Size            =   "6482;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_comment2 
         Caption         =   "Other comments"
         Height          =   255
         Left            =   360
         TabIndex        =   78
         Top             =   840
         Width           =   1515
      End
      Begin VB.Label lbl_comment 
         Caption         =   "Comment"
         Height          =   255
         Left            =   360
         TabIndex        =   77
         Top             =   420
         Width           =   1515
      End
      Begin VB.Label lbl_printed 
         Caption         =   "Printed"
         Height          =   255
         Left            =   360
         TabIndex        =   76
         Top             =   4080
         Width           =   975
      End
   End
   Begin VB.Frame Frm_NewProduct 
      Height          =   4695
      Left            =   120
      TabIndex        =   79
      Top             =   2340
      Visible         =   0   'False
      Width           =   11655
      Begin VB.TextBox txt_NewProductSAPCode 
         Height          =   315
         Left            =   5160
         TabIndex        =   16
         Top             =   360
         Width           =   2835
      End
      Begin VB.TextBox txt_SurfCtnActual 
         Height          =   315
         Left            =   9780
         TabIndex        =   36
         Top             =   3480
         Width           =   1335
      End
      Begin VB.TextBox txt_SurfCtnNominal 
         Height          =   315
         Left            =   9780
         TabIndex        =   35
         Top             =   3960
         Width           =   1335
      End
      Begin VB.TextBox txt_PiecePercarton 
         Height          =   315
         Left            =   9780
         TabIndex        =   34
         Top             =   3000
         Width           =   1335
      End
      Begin VB.TextBox txt_CartonWeigth 
         Height          =   315
         Left            =   9780
         TabIndex        =   33
         Top             =   2520
         Width           =   1335
      End
      Begin VB.TextBox txt_GridType 
         Height          =   315
         Left            =   7680
         TabIndex        =   32
         Top             =   1320
         Width           =   3435
      End
      Begin VB.TextBox txt_Fire 
         Height          =   315
         Left            =   1740
         TabIndex        =   24
         Top             =   3900
         Width           =   1815
      End
      Begin VB.TextBox txt_NominalWidth 
         Height          =   315
         Left            =   5580
         TabIndex        =   26
         Top             =   1500
         Width           =   1335
      End
      Begin VB.TextBox txt_NominalLength 
         Height          =   315
         Left            =   5580
         TabIndex        =   25
         Top             =   1020
         Width           =   1335
      End
      Begin VB.TextBox txt_Weight 
         Height          =   315
         Left            =   5580
         TabIndex        =   31
         Top             =   3960
         Width           =   1335
      End
      Begin VB.TextBox txt_Thickness 
         Height          =   315
         Left            =   5580
         TabIndex        =   30
         Top             =   3465
         Width           =   1335
      End
      Begin VB.TextBox txt_Height 
         Height          =   315
         Left            =   5580
         TabIndex        =   29
         Top             =   2970
         Width           =   1335
      End
      Begin VB.TextBox txt_Width 
         Height          =   315
         Left            =   5580
         TabIndex        =   28
         Top             =   2475
         Width           =   1335
      End
      Begin VB.TextBox txt_Length 
         Height          =   315
         Left            =   5580
         TabIndex        =   27
         Top             =   1980
         Width           =   1335
      End
      Begin VB.Label lbl_CtnWeight 
         Caption         =   "Carton weight"
         Height          =   255
         Left            =   7740
         TabIndex        =   129
         Top             =   2520
         Width           =   1755
      End
      Begin MSForms.ComboBox cbo_color 
         Height          =   315
         Left            =   1740
         TabIndex        =   23
         Top             =   3480
         Width           =   2055
         VariousPropertyBits=   679479321
         DisplayStyle    =   7
         Size            =   "3625;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontEffects     =   1073750016
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_segmentation 
         Height          =   315
         Left            =   1740
         TabIndex        =   22
         Top             =   3075
         Width           =   2055
         VariousPropertyBits=   679479321
         DisplayStyle    =   7
         Size            =   "3625;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontEffects     =   1073750016
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_surface 
         Height          =   315
         Left            =   1740
         TabIndex        =   21
         Top             =   2670
         Width           =   2055
         VariousPropertyBits=   679479321
         DisplayStyle    =   7
         Size            =   "3625;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontEffects     =   1073750016
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_family 
         Height          =   315
         Left            =   1740
         TabIndex        =   18
         Top             =   1410
         Width           =   2055
         VariousPropertyBits=   679479321
         DisplayStyle    =   7
         Size            =   "3625;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontEffects     =   1073750016
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_edgeLength 
         Height          =   315
         Left            =   1740
         TabIndex        =   19
         Top             =   1845
         Width           =   2055
         VariousPropertyBits=   679479321
         DisplayStyle    =   7
         Size            =   "3625;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontEffects     =   1073750016
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_category 
         Height          =   315
         Left            =   1740
         TabIndex        =   17
         Top             =   1020
         Width           =   2055
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "3625;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_EdgeWidth 
         Height          =   315
         Left            =   1740
         TabIndex        =   20
         Top             =   2280
         Width           =   2055
         VariousPropertyBits=   679479321
         DisplayStyle    =   7
         Size            =   "3625;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontEffects     =   1073750016
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_NewProductSAPCode 
         Caption         =   "CLS item number"
         Height          =   315
         Left            =   3540
         TabIndex        =   128
         Top             =   360
         Width           =   1635
      End
      Begin VB.Label lbl_EdgeWidth 
         Caption         =   "Product edge width"
         Height          =   375
         Left            =   180
         TabIndex        =   127
         Top             =   2280
         Width           =   1635
      End
      Begin VB.Label lbl_PiecePerCarton 
         Caption         =   "Piece per carton"
         Height          =   255
         Left            =   7740
         TabIndex        =   90
         Top             =   3060
         Width           =   1755
      End
      Begin VB.Label lbl_SurfCtnNominal 
         Caption         =   "Surface carton nominal"
         Height          =   255
         Left            =   7740
         TabIndex        =   89
         Top             =   4020
         Width           =   1755
      End
      Begin VB.Label lbl_SurfCtnActual 
         Caption         =   "Surface carton actual"
         Height          =   255
         Left            =   7740
         TabIndex        =   88
         Top             =   3540
         Width           =   1755
      End
      Begin VB.Label lbl_length 
         Caption         =   "Actual Length"
         Height          =   315
         Left            =   4260
         TabIndex        =   98
         Top             =   1980
         Width           =   1155
      End
      Begin VB.Label lbl_Width 
         Caption         =   "Actual width"
         Height          =   315
         Left            =   4260
         TabIndex        =   97
         Top             =   2520
         Width           =   915
      End
      Begin VB.Label lbl_Height 
         Caption         =   "Height"
         Height          =   315
         Left            =   4260
         TabIndex        =   96
         Top             =   3000
         Width           =   915
      End
      Begin VB.Label lbl_Thickness 
         Caption         =   "Thickness"
         Height          =   315
         Left            =   4260
         TabIndex        =   95
         Top             =   3510
         Width           =   915
      End
      Begin VB.Label lbl_Weight 
         Caption         =   "Weight"
         Height          =   315
         Left            =   4260
         TabIndex        =   94
         Top             =   4005
         Width           =   915
      End
      Begin VB.Label lbl_NominalWidth 
         Caption         =   "Nominal Width"
         Height          =   315
         Left            =   4260
         TabIndex        =   93
         Top             =   1500
         Width           =   1215
      End
      Begin VB.Label lbl_NominalLength 
         Caption         =   "Nominal Length"
         Height          =   315
         Left            =   4260
         TabIndex        =   92
         Top             =   1020
         Width           =   1155
      End
      Begin VB.Label lbl_grid 
         Caption         =   "Grid type"
         Height          =   255
         Left            =   7680
         TabIndex        =   87
         Top             =   1020
         Width           =   1755
      End
      Begin VB.Label lbl_Fire 
         Caption         =   "Fire class"
         Height          =   375
         Left            =   180
         TabIndex        =   86
         Top             =   3960
         Width           =   1635
      End
      Begin VB.Label lbl_Color 
         Caption         =   "Color"
         Height          =   375
         Left            =   180
         TabIndex        =   85
         Top             =   3540
         Width           =   1635
      End
      Begin VB.Label lbl_segmentation 
         Caption         =   "Segmentation"
         Height          =   375
         Left            =   180
         TabIndex        =   84
         Top             =   3135
         Width           =   1635
      End
      Begin VB.Label lbl_surface 
         Caption         =   "Surface"
         Height          =   375
         Left            =   180
         TabIndex        =   83
         Top             =   2730
         Width           =   1635
      End
      Begin VB.Label lbl_Family 
         Caption         =   "Family"
         Height          =   375
         Left            =   180
         TabIndex        =   82
         Top             =   1470
         Width           =   1635
      End
      Begin VB.Label lbl_edgeLength 
         Caption         =   "Product edge length"
         Height          =   375
         Left            =   180
         TabIndex        =   81
         Top             =   1860
         Width           =   1635
      End
      Begin VB.Label lbl_category 
         Caption         =   "Category"
         Height          =   375
         Left            =   180
         TabIndex        =   80
         Top             =   1080
         Width           =   1635
      End
   End
End
Attribute VB_Name = "Quot_Line_Mtnc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'------------------------------------------------------------------
' Name : Quot_Line_Mtnc
'
' Purpose : Maintenance  on an individual quotation line
'
' Parameters : See below
'
' review : Nov/27/1999 by JC
'------------------------------------------------------------------

' ----------------------------------------------
' Public variables to paste to this form
' ----------------------------------------------
Public ms_Action As String  ' Kind of action requested ("Update","Add","Detail","Delete")
Public ms_Type As String    ' Type of line ("BaseItem","Metal", "New", "Comment")

Public mi_QuotCode As Integer           ' Quotation number
Public mi_Version As Integer            ' Quotation version
Public mi_Line As Integer               ' Line number
Public ms_QuotationLanguage As String   ' Quotation language
Public mi_iConcurrency As Integer

Public mi_Order As Integer             ' Line position
Public ms_UMCode As String             ' Unit of measure
Public ms_QLDesc As String             ' Line description
Public ms_QLQuantity As String         ' Quantity
Public ms_QLUpdQuantity As String      ' Quantity modified around 10%
Public ms_QLStandardPrice As String    ' Standard price
Public ms_CurrCode As String           ' Currency for std price
Public ms_QLPrice As String            ' Price
Public ms_QLAmount As String           ' Total amount
Public ms_QLLeadTime As String         ' Lead time
Public ms_QLPromisedShipping As String ' promised shipping
Public ms_QLPlannedProduction As String 'Planned production
Public ms_PlantCode As String          ' Plant (code)
Public ms_PlantDesc As String          ' Plant (description)
Public ms_PlantConfirmation As String  ' Flag for plant confirmation
Public ms_OrderConfirmation As String  ' Flag for ordered to plant confirmation

Dim mb_SAPLostFocus As Boolean

Private Sub cbo_AcousticInFill_Change()
    UpdateMetalProductDesc
    cbo_AcousticInFill.ToolTipText = cbo_AcousticInFill.value
End Sub

Private Sub cbo_AcousticInFill_DropButtonClick()
    LoadCombo "exec Quot_MetalAcoustic_cbo '" & ms_QuotationLanguage & "'", cbo_AcousticInFill, OK
End Sub

Private Sub Form_Load()
On Error GoTo suite
    MouseOff
    
    If gl_CodePage <> 1252 And gl_CodePage <> 0 Then ChangeCharSet Me

    mb_SAPLostFocus = KO

    ' Load pictures
    SSC_save.Picture = LoadResPicture(RES_OK, 1)
    ssc_quit.Picture = LoadResPicture(RES_QUIT, 1)
    pic_SAPSearch.Picture = LoadResPicture(RES_COMBOCOPYGRAY, 1)
    ' Get screen constants
    Getcsts
    
    '--------------------------------------
    ' Enable and disable fields and frames
    '--------------------------------------
    
    ' Show frame associated to the selected product
    '-----------------------------------------------
    txt_LineDesc.MaxLength = 140
    Select Case ms_Type
            Case "BaseItem": Quot_Line_Mtnc.Height = 5200
                             SSC_save.top = 4200
                             ssc_quit.top = 4200
                             Frm_BaseItem.Visible = OK
            Case "Comment":  frm_Comment.Visible = OK
                             lbl_LineDesc.Visible = KO
                             txt_LineDesc.Visible = KO
                             txt_LineDesc.MaxLength = 2000
            Case "New":      Frm_NewProduct.Visible = OK
            Case "Metal":    frm_MetalProduct.Visible = OK
    End Select
    ' disabled everything
    '---------------------
    FrameEnabled Frm_Common.Name, KO
    FrameEnabled frm_Comment.Name, KO
    FrameEnabled Frm_BaseItem.Name, KO
    FrameEnabled Frm_NewProduct.Name, KO
    FrameEnabled frm_MetalProduct.Name, KO
    frm_PlantConfirmation.Enabled = KO
    lbl_OrderConfirmation.Enabled = KO
    chk_OrderConfirmation.Enabled = KO
    opt_PlantYes.Enabled = KO
    opt_PlantNo.Enabled = KO
    chk_OrderConfirmation.Enabled = KO
    lbl_OrderConfirmation.Enabled = KO
    ' Enabled all fields for adding or updating line
    '------------------------------------------------
    If (gut_Actor.MSC = OK Or ms_Type = "Comment") And (ms_Action = "Add" Or ms_Action = "Update") Then
        FrameEnabled Frm_Common.Name, OK
        frm_PlantConfirmation.Enabled = KO
        lbl_OrderConfirmation.Enabled = KO
        chk_OrderConfirmation.Enabled = KO
        opt_PlantYes.Enabled = KO
        opt_PlantNo.Enabled = KO
        chk_OrderConfirmation.Enabled = KO
        lbl_OrderConfirmation.Enabled = KO
        lbl_promisedShipping.Enabled = KO
        txt_promisedShipping.Enabled = KO
        lbl_plannedProduction.Enabled = KO
        txt_PlannedProduction.Enabled = KO
        If gut_Actor.MSC = OK Then
            lbl_leadTime.Enabled = OK
            txt_LeadTime.Enabled = OK
        Else
            lbl_leadTime.Enabled = KO
            txt_LeadTime.Enabled = KO
        End If
        Select Case ms_Type
            Case "BaseItem": FrameEnabled Frm_BaseItem.Name, OK
                            pic_SAPSearch.Picture = LoadResPicture(RES_COMBOCOPY, 1)
                            lbl_LineDesc.Enabled = KO
                             txt_LineDesc.Enabled = KO
                             txt_LineDesc.Locked = OK
            Case "New":     FrameEnabled Frm_NewProduct.Name, OK
                            lbl_category.Enabled = OK
                             cbo_category.Enabled = OK
            Case "Metal":   FrameEnabled frm_MetalProduct.Name, OK
                            frm_PlantConfirmation.Enabled = KO
                            lbl_OrderConfirmation.Enabled = KO
                            chk_OrderConfirmation.Enabled = KO
                            lbl_TileCost.Enabled = KO
                            txt_TileCost.Enabled = KO
                            lbl_TileSetUp.Enabled = KO
                            txt_TileSetUp.Enabled = KO
                            lbl_DetailCost.Enabled = KO
                            txt_DetailCost.Enabled = KO
                            lbl_DetailSetUp.Enabled = KO
                            txt_DetailSetUp.Enabled = KO
                            lbl_AcousticCost.Enabled = KO
                            txt_AcousticCost.Enabled = KO
                            lbl_AcousticSetUp.Enabled = KO
                            txt_AcousticSetUp.Enabled = KO
            Case "Comment": FrameEnabled frm_Comment.Name, OK
        End Select
    End If
    ' Enabled fiels needed for changing status (Plant confirmations)
    '----------------------------------------------------------------
    If ms_Action = "Update" Then
        If gut_Actor.MSC = OK Then
            lbl_Price.Enabled = OK
            txt_Price.Enabled = OK
            lbl_leadTime.Enabled = OK
            txt_LeadTime.Enabled = OK
        End If
        lbl_StdPrice.Enabled = OK
        txt_stdPrice.Enabled = OK
        cbo_currency.Enabled = OK
        If gut_Actor.COS = OK Then
            Lbl_Quantity.Enabled = OK
            txt_Quantity.Enabled = OK
        End If
        
        If gi_QuotationStatusCode = Quotation_Status.Waiting_Plant_Confirmation _
           Or gi_QuotationStatusCode = Quotation_Status.Ordered_to_plant _
           Or gi_QuotationStatusCode = Quotation_Status.Refused_Notify_customer _
           Then
            ' Common fields
            lbl_leadTime.Enabled = OK
            txt_LeadTime.Enabled = OK
            lbl_promisedShipping.Enabled = OK
            txt_promisedShipping.Enabled = OK
            lbl_plannedProduction.Enabled = OK
            txt_PlannedProduction.Enabled = OK
            ' Metal fields
            lbl_TileCost.Enabled = OK
            txt_TileCost.Enabled = OK
            lbl_TileSetUp.Enabled = OK
            txt_TileSetUp.Enabled = OK
            lbl_DetailCost.Enabled = OK
            txt_DetailCost.Enabled = OK
            lbl_DetailSetUp.Enabled = OK
            txt_DetailSetUp.Enabled = OK
            lbl_AcousticCost.Enabled = OK
            txt_AcousticCost.Enabled = OK
            lbl_AcousticSetUp.Enabled = OK
            txt_AcousticSetUp.Enabled = OK
            ' New item fields
            FrameEnabled Frm_NewProduct.Name, KO
            lbl_NewProductSAPCode.Enabled = OK
            txt_NewProductSAPCode.Enabled = OK
            lbl_Weight.Enabled = OK
            txt_Weight.Enabled = OK
            lbl_CtnWeight.Enabled = OK
            txt_CartonWeigth.Enabled = OK
            lbl_PiecePerCarton.Enabled = OK
            txt_PiecePercarton.Enabled = OK
            lbl_SurfCtnActual.Enabled = OK
            txt_SurfCtnActual.Enabled = OK
            lbl_SurfCtnNominal.Enabled = OK
            txt_SurfCtnNominal.Enabled = OK
        End If
        Select Case gi_QuotationStatusCode
            Case Quotation_Status.Waiting_Plant_Confirmation, Refused_Notify_customer:
                    frm_PlantConfirmation.Enabled = OK
                    opt_PlantYes.Enabled = OK
                    opt_PlantNo.Enabled = OK
            Case Quotation_Status.Enter_customer_order:
                    Lbl_Quantity.Enabled = OK
                    txt_Quantity.Enabled = OK
            Case Quotation_Status.Ordered_to_plant:
                    lbl_OrderConfirmation.Enabled = OK
                    chk_OrderConfirmation.Enabled = OK
            End Select
    End If
    
    ' Hide the confirm button
    If ms_Action = "Detail" Then SSC_save.Visible = KO

    ' Fill the fields with current values
    If ms_Action <> "Add" Then initvalues
    
    ' Set default plant for adding
    If ms_Action = "Add" And ms_Type <> "Comment" Then
        If gs_QuotationPlantCode <> "" Then
            MCombo_AddItemCode cbo_Plant, gs_QuotationPlantCode, gs_QuotationPlantDesc
            frm_PlantConfirmation.Visible = OK
            lbl_OrderConfirmation.Visible = OK
            chk_OrderConfirmation.Visible = OK
        End If
    End If
    ' Initialised variables
    '-----------------------
    gb_Return = KO
    cbo_unitOfMesure.Tag = UNLOADED
    cbo_currency.Tag = UNLOADED
    cbo_Plant.Tag = UNLOADED
    cbo_category.Tag = UNLOADED
    cbo_color.Tag = UNLOADED
    cbo_edgeLength.Tag = UNLOADED
    cbo_EdgeWidth.Tag = UNLOADED
    cbo_family.Tag = UNLOADED
    cbo_segmentation.Tag = UNLOADED
    cbo_surface.Tag = UNLOADED
    cbo_comment.Tag = UNLOADED
    cbo_Perforation.Tag = UNLOADED
    cbo_Gasket.Tag = UNLOADED
    cbo_Material.Tag = UNLOADED
    cbo_Finish.Tag = UNLOADED
    cbo_Border.Tag = UNLOADED
    cbo_System.Tag = UNLOADED
    cbo_AcousticInFill.Tag = UNLOADED
    cbo_EdgeLeft.Tag = UNLOADED
    cbo_EdgeRight.Tag = UNLOADED
    cbo_EdgeTop.Tag = UNLOADED
    cbo_EdgeBottom.Tag = UNLOADED
    MouseOn
    Exit Sub
suite:
    StdError
End Sub

Private Sub Getcsts()
Dim ls_Req As String
Dim ls_Field As String
Dim ls_Text As String
Dim ll_Statement As Long
Dim li_Status As Integer

On Error GoTo suite

ls_Req = "EXEC Screen_Csts 'Quot_Line_Mtnc', '" & gut_LangLogin.Code & "'"
   If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
       li_Status = SQL_SUCCESS
   Else
       li_Status = SQL_ERROR
   End If
   Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
       li_Status = SQLFetch(ll_Statement)
       If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
           ls_Field = ODBCData(ll_Statement, 1)
           ls_Text = ODBCData(ll_Statement, 2)
           Select Case ls_Field
               Case "Title": Quot_Line_Mtnc.Caption = ls_Text
               Case "System": lbl_System.Caption = ls_Text
               Case "Border": lbl_Border.Caption = ls_Text
               Case "Perforation": lbl_Perforation.Caption = ls_Text
               Case "Finish": lbl_Finish.Caption = ls_Text
               Case "Material": lbl_Material.Caption = ls_Text
               Case "Gasket": lbl_Gasket.Caption = ls_Text
               Case "EdgeBottom": lbl_EdgeBottom.Caption = ls_Text
               Case "EdgeTop": lbl_EdgeTop.Caption = ls_Text
               Case "EdgeRight": lbl_EdgeRight.Caption = ls_Text
               Case "EdgeLeft": lbl_EdgeLeft.Caption = ls_Text
               Case "FaceSize": lbl_FaceSize.Caption = ls_Text
               Case "PanelModule": lbl_PanelModule.Caption = ls_Text
               Case "BISAPCode": lbl_BISAPCode.Caption = ls_Text
               Case "CartonPerPallet": lbl_CartonPerPallet.Caption = ls_Text
               Case "CartonWeight": lbl_CartonWeight.Caption = ls_Text
               Case "SurfacePerCarton": lbl_SurfacePerCarton.Caption = ls_Text
               Case "PiecePerCtn": lbl_PiecePerCtn.Caption = ls_Text
               Case "SurfacePerPiece": lbl_SurfacePerPiece.Caption = ls_Text
               Case "AcousticSetUp": lbl_AcousticSetUp.Caption = ls_Text
               Case "AcousticCost": lbl_AcousticCost.Caption = ls_Text
               Case "DetailSetUp": lbl_DetailSetUp.Caption = ls_Text
               Case "DetailCost": lbl_DetailCost.Caption = ls_Text
               Case "TileSetUp": lbl_TileSetUp.Caption = ls_Text
               Case "TileCost": lbl_TileCost.Caption = ls_Text
               Case "NewProductSAPCode": lbl_NewProductSAPCode.Caption = ls_Text
               Case "EdgeWidth": lbl_EdgeWidth.Caption = ls_Text
               Case "CartonWeigth": lbl_CtnWeight.Caption = ls_Text
               Case "PiecePerCarton": lbl_PiecePerCarton.Caption = ls_Text
               Case "SurfCtnNominal": lbl_SurfCtnNominal.Caption = ls_Text
               Case "SurfCtnActual": lbl_SurfCtnActual.Caption = ls_Text
               Case "length": lbl_length.Caption = ls_Text
               Case "Width": lbl_Width.Caption = ls_Text
               Case "Height": lbl_Height.Caption = ls_Text
               Case "Thickness": lbl_Thickness.Caption = ls_Text
               Case "Weight": lbl_Weight.Caption = ls_Text
               Case "NominalWidth": lbl_NominalWidth.Caption = ls_Text
               Case "NominalLength": lbl_NominalLength.Caption = ls_Text
               Case "grid": lbl_grid.Caption = ls_Text
               Case "Fire": lbl_Fire.Caption = ls_Text
               Case "Color": lbl_Color.Caption = ls_Text
               Case "segmentation": lbl_segmentation.Caption = ls_Text
               Case "surface": lbl_surface.Caption = ls_Text
               Case "Family": lbl_Family.Caption = ls_Text
               Case "edgeLength": lbl_edgeLength.Caption = ls_Text
               Case "category": lbl_category.Caption = ls_Text
               Case "SAPCode": lbl_SAPCode.Caption = ls_Text
               Case "comment2": lbl_comment2.Caption = ls_Text
               Case "comment": lbl_comment.Caption = ls_Text
               Case "printed": lbl_printed.Caption = ls_Text
               Case "PlantNo": opt_PlantNo.Caption = ls_Text
               Case "PlantYes": opt_PlantYes.Caption = ls_Text
               Case "OrderConfirmation": lbl_OrderConfirmation.Caption = ls_Text
               Case "Plant": lbl_Plant.Caption = ls_Text
               Case "leadTime": lbl_leadTime.Caption = ls_Text
               Case "promisedShipping": lbl_promisedShipping.Caption = ls_Text
               Case "plannedProduction": lbl_plannedProduction.Caption = ls_Text
               Case "LineDesc": lbl_LineDesc.Caption = ls_Text
               Case "Amount": lbl_Amount.Caption = ls_Text
               Case "Price": lbl_Price.Caption = ls_Text
               Case "StdPrice": lbl_StdPrice.Caption = ls_Text
               Case "Quantity": Lbl_Quantity.Caption = ls_Text
               Case "UnitOfMesure": Lbl_UnitOfMesure.Caption = ls_Text
           End Select
       End If
   Loop
   li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
   Exit Sub
suite:
   li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
   StdError
End Sub

Private Sub FrameEnabled(ms_Frame As String, mb_Enabled As Boolean)
'------------------------------------------------------------------
' Name : Quot_Line_Mtnc
'
' Purpose : Enabled or disabled ALL the components of the frame
'
' Parameters :
'               ms_Frame: Name of the frame to disabled or enabled
'               mb_Enabled: Set enabled or disabled (OK or KO)
'
' review : Nov/27/1999 by JC
'------------------------------------------------------------------
Dim ls_Count As Integer
    For ls_Count = 0 To Me.Count - 2
        If Me.Controls(ls_Count).Container.Name = ms_Frame Then Me.Controls(ls_Count).Enabled = mb_Enabled
    Next
End Sub

Private Sub UpdateNewProductDesc()
'-------------------------------------------------------
' On chosing a value in a combo, update the description
'-------------------------------------------------------
    txt_LineDesc.Text = left(cbo_family.value, 20) & " " & left(cbo_surface.value, 20) & " " & _
                left(cbo_segmentation.value, 20) & " " & left(cbo_color.value, 20)
End Sub
Private Sub UpdateMetalProductDesc()
    txt_LineDesc.Text = left(txt_BISAPCode.Text, 20) & " " & left(cbo_System.value, 20) & " " & left(txt_Panel.Text, 20) & " " & _
                left(txt_FaceSize.Text, 20) & " " & left(cbo_Gasket.value, 20) & " " & left(cbo_Material.value, 20) & " " & _
                left(cbo_Perforation.value, 20) & " " & left(cbo_Border.value, 20) & " " & left(cbo_Finish.value, 20)
End Sub

Private Sub Cbo_category_Click()
'------------------------------------------------------------------
' Reset all fiels for new product when the category has changed
'------------------------------------------------------------------
    UpdateNewProductDesc
    ' Empty all combos
    cbo_color.Clear
    cbo_edgeLength.Clear
    cbo_EdgeWidth.Clear
    cbo_family.Clear
    cbo_segmentation.Clear
    cbo_surface.Clear
    cbo_color.Tag = UNLOADED
    cbo_edgeLength.Tag = UNLOADED
    cbo_EdgeWidth.Tag = UNLOADED
    cbo_family.Tag = UNLOADED
    cbo_segmentation.Tag = UNLOADED
    cbo_surface.Tag = UNLOADED
    ' Enabled others combo for modifications
    If gi_QuotationStatusCode = Quotation_Status.opened And ms_Action <> "Detail" And ms_Action <> "Delete" Then FrameEnabled Frm_NewProduct.Name, OK
    cbo_category.ToolTipText = cbo_category.value
End Sub

Private Sub cbo_comment_Click()
'----------------------------------------------------------------
' Get the long description when a predefined comment is chosen
'----------------------------------------------------------------
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Req As String
    On Error GoTo suite
    If MCombo_GetCode(cbo_comment) <> "None" Then
        ls_Req = "EXEC quot_comment_sel2 " & MCombo_GetCode(cbo_comment) & ",'" & ms_QuotationLanguage & "'"
        If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
            li_Status = SQL_SUCCESS
        Else
            li_Status = SQL_ERROR
        End If
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                txt_comment.Text = ODBCData(ll_Statement, 1)
            End If
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        End If
    Else
        txt_comment.Text = ""
    End If
    cbo_comment.ToolTipText = cbo_comment.value
    Exit Sub
suite:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub
'------------------------------------------------------------------------------------
' When combo's changed, update the line description and put the value in the tooltip
'------------------------------------------------------------------------------------
Private Sub cbo_color_Click()
    UpdateNewProductDesc
    cbo_color.ToolTipText = cbo_color.value
End Sub
Private Sub cbo_edgelength_Click()
    UpdateNewProductDesc
    cbo_edgeLength.ToolTipText = cbo_edgeLength.value
End Sub
Private Sub cbo_edgewidth_Click()
    UpdateNewProductDesc
    cbo_EdgeWidth.ToolTipText = cbo_EdgeWidth.value
End Sub
Private Sub cbo_family_Click()
    UpdateNewProductDesc
    cbo_family.ToolTipText = cbo_family.value
End Sub
Private Sub cbo_segmentation_Click()
    UpdateNewProductDesc
    cbo_segmentation.ToolTipText = cbo_segmentation.value
End Sub
Private Sub cbo_Surface_Click()
    UpdateNewProductDesc
    cbo_surface.ToolTipText = cbo_surface.value
End Sub

Private Sub cbo_Border_Click()
    UpdateMetalProductDesc
    cbo_Border.ToolTipText = cbo_Border.value
End Sub
Private Sub cbo_EdgeBottom_Click()
    cbo_EdgeBottom.ToolTipText = cbo_EdgeBottom.value
End Sub
Private Sub cbo_EdgeLeft_Click()
    cbo_EdgeLeft.ToolTipText = cbo_EdgeLeft.value
End Sub
Private Sub cbo_EdgeRight_Click()
    cbo_EdgeRight.ToolTipText = cbo_EdgeRight.value
End Sub
Private Sub cbo_EdgeTop_Click()
    cbo_EdgeTop.ToolTipText = cbo_EdgeTop.value
End Sub
Private Sub cbo_Finish_Click()
    UpdateMetalProductDesc
    cbo_Finish.ToolTipText = cbo_Finish.value
End Sub
Private Sub cbo_Gasket_Click()
    UpdateMetalProductDesc
    cbo_Gasket.ToolTipText = cbo_Gasket.value
End Sub
Private Sub cbo_Material_Click()
    UpdateMetalProductDesc
    cbo_Material.ToolTipText = cbo_Material.value
End Sub
Private Sub cbo_Perforation_Click()
    UpdateMetalProductDesc
    cbo_Perforation.ToolTipText = cbo_Perforation.value
End Sub
Private Sub cbo_System_Click()
    UpdateMetalProductDesc
    cbo_System.ToolTipText = cbo_System.value
End Sub

Private Sub txt_Panel_LostFocus()
    UpdateMetalProductDesc
End Sub
Private Sub txt_FaceSize_LostFocus()
    UpdateMetalProductDesc
End Sub

Private Sub cbo_Plant_Click()
    ' The plant is deselected
    If MCombo_GetCode(cbo_Plant) <> "None" Then
        frm_PlantConfirmation.Visible = OK
        chk_OrderConfirmation.Visible = OK
        lbl_OrderConfirmation.Visible = OK
    Else
    ' A new plant is selected
        frm_PlantConfirmation.Visible = KO
        chk_OrderConfirmation.Visible = KO
        lbl_OrderConfirmation.Visible = KO
    End If
    ' Clear the fields associated with the plant
        opt_PlantYes.value = KO
        opt_PlantNo.value = KO
        chk_OrderConfirmation.value = 0
        cbo_Plant.ToolTipText = cbo_Plant.value
End Sub

Private Sub LoadCombo(ls_Req As String, cbo_Combo As msforms.ComboBox, BlankLine As Boolean)
'-------------------------------------------------------------
' Drop down a combo and load it if necessary with ls_req
'-------------------------------------------------------------
Dim lv_Code

    If cbo_Combo.Tag <> Loaded Then
        MouseOff
        lv_Code = MCombo_GetCode(cbo_Combo)
        cbo_Combo.Clear
        If BlankLine = OK Then
            ' Add a blank line to deselect
            MCombo_AddItemCode cbo_Combo, "None", ""
        End If
        MCombo_Fill cbo_Combo, ls_Req
        MCombo_CodeSelect(cbo_Combo) = lv_Code
        cbo_Combo.Tag = Loaded
        MouseOn
    End If
End Sub

'----------------------------------
' Fill the combo when dropped down
'----------------------------------
Private Sub cbo_Perforation_DropButtonClick()
    LoadCombo "exec Quot_MetalPerforation_cbo '" & ms_QuotationLanguage & "'", cbo_Perforation, OK
End Sub
Private Sub cbo_Gasket_DropButtonclick()
    LoadCombo "exec Quot_MetalGasket_cbo '" & ms_QuotationLanguage & "'", cbo_Gasket, OK
End Sub
Private Sub cbo_material_DropButtonclick()
    LoadCombo "exec Quot_MetalMaterial_cbo '" & ms_QuotationLanguage & "'", cbo_Material, OK
End Sub
Private Sub cbo_Finish_DropButtonClick()
    LoadCombo "exec Quot_MetalFinish_cbo '" & ms_QuotationLanguage & "'", cbo_Finish, OK
End Sub
Private Sub cbo_Border_DropButtonClick()
    LoadCombo "exec Quot_MetalBorder_cbo '" & ms_QuotationLanguage & "'", cbo_Border, OK
End Sub
Private Sub cbo_System_DropButtonClick()
    LoadCombo "exec Quot_MetalSystem_cbo '" & ms_QuotationLanguage & "'", cbo_System, OK
End Sub
Private Sub cbo_EdgeLeft_DropButtonclick()
    LoadCombo "exec Quot_MetalEdge_cbo '" & ms_QuotationLanguage & "'", cbo_EdgeLeft, OK
End Sub
Private Sub cbo_EdgeRight_DropButtonClick()
    LoadCombo "exec Quot_MetalEdge_cbo '" & ms_QuotationLanguage & "'", cbo_EdgeRight, OK
End Sub
Private Sub cbo_EdgeTop_DropButtonClick()
    LoadCombo "exec Quot_MetalEdge_cbo '" & ms_QuotationLanguage & "'", cbo_EdgeTop, OK
End Sub
Private Sub cbo_EdgeBottom_DropButtonClick()
    LoadCombo "exec Quot_MetalEdge_cbo '" & ms_QuotationLanguage & "'", cbo_EdgeBottom, OK
End Sub
Private Sub Cbo_category_DropButtonClick()
    LoadCombo "exec categories_cbo '" & ms_QuotationLanguage & "'", cbo_category, KO
End Sub
Private Sub cbo_color_DropButtonClick()
    LoadCombo "exec colours_cbo '" & MCombo_GetCode(cbo_category) & "','" & ms_QuotationLanguage & "'", cbo_color, KO
End Sub
Private Sub cbo_edgelength_DropButtonClick()
    LoadCombo "exec products_edges_cbo '" & MCombo_GetCode(cbo_category) & "','" & ms_QuotationLanguage & "'", cbo_edgeLength, KO
End Sub
Private Sub cbo_edgewidth_DropButtonClick()
    LoadCombo "exec products_edges_cbo '" & MCombo_GetCode(cbo_category) & "','" & ms_QuotationLanguage & "'", cbo_EdgeWidth, KO
End Sub
Private Sub cbo_family_DropButtonClick()
    LoadCombo "exec products_families_cbo '" & MCombo_GetCode(cbo_category) & "','" & ms_QuotationLanguage & "'", cbo_family, KO
End Sub
Private Sub cbo_Segmentation_DropButtonClick()
    LoadCombo "exec products_segmentation_cbo '" & MCombo_GetCode(cbo_category) & "','" & ms_QuotationLanguage & "'", cbo_segmentation, KO
End Sub
Private Sub cbo_surface_DropButtonClick()
    LoadCombo "exec surfaces_cbo '" & MCombo_GetCode(cbo_category) & "','" & ms_QuotationLanguage & "'", cbo_surface, KO
End Sub
Private Sub cbo_comment_DropButtonClick()
    LoadCombo "exec quot_comment_cbo '" & ms_QuotationLanguage & "'", cbo_comment, OK
End Sub
Private Sub cbo_unitOfMesure_DropButtonClick()
    LoadCombo "exec unit_of_measure_cbo2 '" & ms_QuotationLanguage & "'", cbo_unitOfMesure, OK
End Sub
Private Sub cbo_currency_DropButtonclick()
    LoadCombo "exec currencies_cbo2 '" & ms_QuotationLanguage & "'", cbo_currency, OK
End Sub
Private Sub Cbo_plant_DropButtonClick()
    LoadCombo "exec plants_cbo '" & ms_QuotationLanguage & "'", cbo_Plant, OK
End Sub

Private Sub initvalues()
'-----------------------------------------------
' Fill all the fields with currents values
'-----------------------------------------------
Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Code As String
Dim ls_Desc As String
Dim ls_Printed As String
   
On Error GoTo suite
    
    ' COMMON: init the quotline values from public parameters
    '-------------------------------------------------------------
    If ms_UMCode <> "" Then                         ' UNIT OF MEASURE
        ls_Req = "exec unit_of_measure_sel2 '" & ms_UMCode & "','" & ms_QuotationLanguage & "'"
        If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
            li_Status = SQL_SUCCESS
        Else
            li_Status = SQL_ERROR
        End If
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                MCombo_AddItemCode cbo_unitOfMesure, ms_UMCode, ODBCData(ll_Statement, 1)
            End If
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        End If
    End If
    If ms_CurrCode <> "" Then                         ' CURRENCY
        ls_Req = "exec currencies_sel2 '" & ms_CurrCode & "','" & ms_QuotationLanguage & "'"
        If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
            li_Status = SQL_SUCCESS
        Else
            li_Status = SQL_ERROR
        End If
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                MCombo_AddItemCode cbo_currency, ms_CurrCode, ODBCData(ll_Statement, 1)
            End If
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        End If
    End If
    txt_LineDesc = ms_QLDesc                        ' LINE DESCRIPTION
    txt_Quantity = ms_QLUpdQuantity                 ' QUANTITY
    txt_stdPrice = ms_QLStandardPrice               ' STANDARD PRICE
    txt_Price = ms_QLPrice                          ' PRICE
    txt_Amount = ms_QLAmount                        ' AMOUNT
    txt_LeadTime = ms_QLLeadTime                    ' LEADTIME
    txt_promisedShipping.SetDate = ms_QLPromisedShipping    ' PROMISED SHIPPING
    txt_PlannedProduction.SetDate = ms_QLPlannedProduction  ' PLANNED PRODUCTION
    If ms_PlantCode <> "" Then                      ' PLANT
        MCombo_AddItemCode cbo_Plant, ms_PlantCode, ms_PlantDesc
        frm_PlantConfirmation.Visible = OK
        lbl_OrderConfirmation.Visible = OK
        chk_OrderConfirmation.Visible = OK
    End If
    If ms_PlantConfirmation = "Y" Then opt_PlantYes.value = OK          ' PLANT CONFIRMATION
    If ms_PlantConfirmation = "N" Then opt_PlantNo.value = OK
    If ms_OrderConfirmation = "Y" Then chk_OrderConfirmation.value = 1  'ORDERED CONFIRMATION
       
    ' BASE ITEM: Request and fill the values for Base item
    '-------------------------------------------------------
    If ms_Type = "BaseItem" Then
        ls_Req = "exec Quot_Product_sel " & mi_QuotCode & "," & mi_Version & "," & mi_Line
        If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
            li_Status = SQL_SUCCESS
        Else
        li_Status = SQL_ERROR
        End If
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                txt_SapCode = ODBCData(ll_Statement, 1) ' SAP CODE
            End If
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        End If
    End If
    
    ' COMMENT: Request and fill the values for Comment lines
    '---------------------------------------------------------
    If ms_Type = "Comment" Then
        ls_Req = "exec Quot_comment_line_sel " & mi_QuotCode & "," & mi_Version & "," & mi_Line & ",'" & ms_QuotationLanguage & "'"
            If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
            li_Status = SQL_SUCCESS
        Else
        li_Status = SQL_ERROR
        End If
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                ls_Code = ODBCData(ll_Statement, 1)         ' PREDEFINED COMMENT
                ls_Desc = ODBCData(ll_Statement, 2)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_comment, ls_Code, ls_Desc
                txt_comment = ODBCData(ll_Statement, 3)     ' USER COMMENT
                ls_Printed = ODBCData(ll_Statement, 4)      ' PRINTED FLAG
                If ls_Printed = "Y" Then chk_printed = 1 Else chk_printed = 0
            End If
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        End If
    End If
    
    ' METAL PRODUCT: Request the values for new product
    '---------------------------------------------------
    If ms_Type = "Metal" Then
        ls_Req = "exec Quot_MetalProduct_sel " & mi_QuotCode & "," & mi_Version & "," & mi_Line & ",'" & ms_QuotationLanguage & "'"
            If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
            li_Status = SQL_SUCCESS
        Else
        li_Status = SQL_ERROR
        End If
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                txt_BISAPCode = ODBCData(ll_Statement, 1)           ' SAP CODE
                txt_Panel = ODBCData(ll_Statement, 2)               ' PANEL MODULE
                txt_FaceSize = ODBCData(ll_Statement, 3)            ' FACE SIZE
                txt_TileCost = ODBCData(ll_Statement, 4)            ' TILE COST
                txt_TileSetUp = ODBCData(ll_Statement, 5)           ' TILE SET-UP
                txt_DetailCost = ODBCData(ll_Statement, 6)          ' DETAIL COST
                txt_DetailSetUp = ODBCData(ll_Statement, 7)         ' DETAIL SET-UP
                txt_AcousticCost = ODBCData(ll_Statement, 8)        ' ACOUSTIC COST
                txt_AcousticSetUp = ODBCData(ll_Statement, 9)       ' ACOUSTIC SET-UP
                txt_SurfacePerPiece = ODBCData(ll_Statement, 10)    ' SURFACE/PIECE
                txt_PiecePerCtn = ODBCData(ll_Statement, 11)        ' PIECE/CARTON
                txt_SurfacePerCarton = ODBCData(ll_Statement, 12)   ' SURFACE/CARTON
                txt_CartonWeight = ODBCData(ll_Statement, 13)       ' CARTON WEIGHT
                txt_CartonPerPallet = ODBCData(ll_Statement, 14)    ' CARTON/PALLET
                ls_Code = ODBCData(ll_Statement, 15)                ' GASKET CBO
                ls_Desc = ODBCData(ll_Statement, 16)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_Gasket, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 17)                ' MATERIAL CBO
                ls_Desc = ODBCData(ll_Statement, 18)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_Material, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 19)                ' FINISH CBO
                ls_Desc = ODBCData(ll_Statement, 20)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_Finish, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 21)                ' PERFORATION CBO
                ls_Desc = ODBCData(ll_Statement, 22)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_Perforation, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 23)                ' BORDER CBO
                ls_Desc = ODBCData(ll_Statement, 24)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_Border, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 25)                ' SYSTEM CBO
                ls_Desc = ODBCData(ll_Statement, 26)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_System, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 27)                ' TOP EDGE DETAIL CBO
                ls_Desc = ODBCData(ll_Statement, 28)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_AcousticInFill, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 29)                ' TOP EDGE DETAIL CBO
                ls_Desc = ODBCData(ll_Statement, 30)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_EdgeTop, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 31)                ' BOTTOM EDGE DETAIL CBO
                ls_Desc = ODBCData(ll_Statement, 32)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_EdgeBottom, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 33)                ' LEFT EDGE DETAIL CBO
                ls_Desc = ODBCData(ll_Statement, 34)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_EdgeLeft, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 35)                ' RIGHT EDGE DETAIL CBO
                ls_Desc = ODBCData(ll_Statement, 36)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_EdgeRight, ls_Code, ls_Desc
            End If
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        End If
    End If
    
    
    ' NEW PRODUCT : Request and fill the values for new product
    '--------------------------------------------------------------
    If ms_Type = "New" Then
        ls_Req = "exec Quot_NewProduct_sel " & mi_QuotCode & "," & mi_Version & "," & mi_Line & ",'" & ms_QuotationLanguage & "'"
            If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
            li_Status = SQL_SUCCESS
        Else
        li_Status = SQL_ERROR
        End If
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                txt_Fire = ODBCData(ll_Statement, 1)                ' FIRE CLASS
                txt_Width = ODBCData(ll_Statement, 2)               ' ACTUAL WIDTH
                txt_Length = ODBCData(ll_Statement, 3)              ' ACTUAL LENGTH
                txt_NominalWidth = ODBCData(ll_Statement, 4)        ' NOMINAL WIDTH
                txt_NominalLength = ODBCData(ll_Statement, 5)       ' NOMINAL LENGTH
                txt_Height = ODBCData(ll_Statement, 6)              ' HEIGHT
                txt_Thickness = ODBCData(ll_Statement, 7)           ' THICKNESS
                txt_Weight = ODBCData(ll_Statement, 8)              ' WEIGHT
                txt_GridType = ODBCData(ll_Statement, 9)            ' GRID TYPE
                txt_CartonWeigth = ODBCData(ll_Statement, 10)       ' CARTON WEIGHT
                txt_PiecePercarton = ODBCData(ll_Statement, 11)     ' PIECE PER CARTON
                txt_SurfCtnNominal = ODBCData(ll_Statement, 12)     ' SURFACE/CARTON NOMINAL
                txt_SurfCtnActual = ODBCData(ll_Statement, 13)      ' SURFACE/CARTON ACTUAL
                ls_Code = ODBCData(ll_Statement, 14)                ' CATEGORY CBO
                ls_Desc = ODBCData(ll_Statement, 15)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_category, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 16)                ' COLOR CBO
                ls_Desc = ODBCData(ll_Statement, 17)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_color, ls_Code, ls_Desc
                txt_NewProductSAPCode = ODBCData(ll_Statement, 18)  ' SAP Code
                ls_Code = ODBCData(ll_Statement, 19)                ' PRODUCT EDGE LENGTH CBO
                ls_Desc = ODBCData(ll_Statement, 20)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_edgeLength, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 21)                ' PRODUCT EDGE WIDTH CBO
                ls_Desc = ODBCData(ll_Statement, 22)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_EdgeWidth, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 23)                ' PRODUCT FAMILY CBO
                ls_Desc = ODBCData(ll_Statement, 24)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_family, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 25)                ' PRODUCT SEGMENTATION CBO
                ls_Desc = ODBCData(ll_Statement, 26)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_segmentation, ls_Code, ls_Desc
                ls_Code = ODBCData(ll_Statement, 27)                ' SURFACE CBO
                ls_Desc = ODBCData(ll_Statement, 28)
                If ls_Code <> "" Then MCombo_AddItemCode cbo_surface, ls_Code, ls_Desc
            End If
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        End If
    End If
    Exit Sub
suite:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub

Private Sub pic_SAPSearch_Click()
'-----------------------------------------
' Call "Quick search" to get an SAP code
'-----------------------------------------
Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
    ' Select an Sap code from "Quick Search'
    gs_CGCode = ""
    gs_Photo = ""
    Load Item_sel
    Item_sel.ms_TypeCodeReturn = 0
    Item_sel.show 1
    If gb_Return = OK Then
        txt_SapCode = gs_Photo
    End If
    
    cbo_unitOfMesure_DropButtonClick
    
    ' Get the description
    On Error GoTo suite
    ls_Req = "exec Base_Item_Desc_t_sel '" & gs_Photo & "','" & ms_QuotationLanguage & "'"
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQL_SUCCESS
    Else
        li_Status = SQL_ERROR
    End If
    Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or _
           li_Status = SQL_SUCCESS_WITH_INFO Then
            txt_LineDesc = gs_Photo & ": " & ODBCData(ll_Statement, 1)
            If ODBCData(ll_Statement, 2) = "Y" Then
                SendMessage 133, "Warning: This CLS Item is dropped", gut_LangLogin.Code, vbOKOnly
            End If
            MCombo_CodeSelect(cbo_unitOfMesure) = UCase(ODBCData(ll_Statement, 3))
        End If
    Loop
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    txt_SapCode.SetFocus
    Exit Sub
suite:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    txt_SapCode.SetFocus
    StdError
End Sub

Private Sub ssc_quit_Click()
'-------------------------------
' Quit the windows
'-------------------------------
    Unload Me
End Sub

Private Sub ssc_save_Click()
'------------------------------------------------
' Write the informations to DB if everythings OK
'------------------------------------------------
    
    If mb_SAPLostFocus = OK Then Exit Sub
   
    MouseOff
    If ms_Action <> "Delete" Then
        If Control <> OK Then
            MouseOn
            Exit Sub
        End If
    End If
    CreateRequest
    MouseOn
    Unload Me
End Sub

Private Function ParameterLine(ls_Procedure As String) As String
'----------------------------------------------------------
' Construct the request string for the common quot_line
'----------------------------------------------------------
Dim ls_Req As String

    ' Calculate the total amount
    If txt_Quantity <> "" Then txt_Amount.Text = Formatage2(Val(txt_Quantity) * Val(txt_Price))
       
    ls_Req = "EXEC " & ls_Procedure & " " & mi_QuotCode & "," & mi_Version
    ' Unit of measure
    If MCombo_GetCode(cbo_unitOfMesure) = "None" Or cbo_unitOfMesure.ListIndex = -1 Then
        ls_Req = ls_Req & ",Null"
    Else
        ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_unitOfMesure) & "'"
    End If
    ' Currency
    If MCombo_GetCode(cbo_currency) = "None" Or cbo_currency.ListIndex = -1 Then
        ls_Req = ls_Req & ",Null"
    Else
        ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_currency) & "'"
    End If
    
    ls_Req = ls_Req & ",'" & QuoteParam(txt_LineDesc) & "'"
    ls_Req = ls_Req & ",'" & ms_Type & "'"
    If gi_QuotationStatusCode = Quotation_Status.opened Or ms_Action = "Add" Then
        If txt_Quantity = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Quantity
    Else
        If ms_QLQuantity = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & ms_QLQuantity
    End If
    If txt_Quantity = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Quantity
    If txt_stdPrice = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_stdPrice
    If txt_Price = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Price
    If txt_Amount = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Amount
    ls_Req = ls_Req & ",'W'"
    If txt_LeadTime = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_LeadTime
    If txt_promisedShipping.GetUSDate = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & ",'" & txt_promisedShipping.GetUSDate & "'"
    If txt_PlannedProduction.GetUSDate = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & ",'" & txt_PlannedProduction.GetUSDate & "'"
    ' Plant
    If MCombo_GetCode(cbo_Plant) = "None" Or cbo_Plant.ListIndex = -1 Then
        ls_Req = ls_Req & ",Null"
    Else
        ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_Plant) & "'"
    End If
    ' Plant accepted
    If opt_PlantYes.value = OK Or MCombo_GetCode(cbo_Plant) = "None" Or cbo_Plant.ListIndex = -1 Then
        ls_Req = ls_Req & ",'Y'"
    ElseIf opt_PlantNo.value = OK Then ls_Req = ls_Req & ",'N'"
    Else
        ls_Req = ls_Req & ",Null"
    End If
    ' Order confirmed
    If chk_OrderConfirmation.value = 1 Or MCombo_GetCode(cbo_Plant) = "None" Or cbo_Plant.ListIndex = -1 Then
        ls_Req = ls_Req & ",'Y'"
    Else
        ls_Req = ls_Req & ",Null"
    End If
    ls_Req = ls_Req & ",'','',Null"
    ParameterLine = ls_Req
End Function

Private Function ParameterProduct(ls_Procedure As String) As String
'--------------------------------------------------------------------
' Construct the request string for an existing product (Quot_Product)
'--------------------------------------------------------------------
Dim ls_Req As String

    ls_Req = "exec " & ls_Procedure & " " & mi_QuotCode & "," & mi_Version & "," & mi_Line & ",'" & _
                txt_SapCode & "','','',Null"
    ParameterProduct = ls_Req
End Function

Private Function ParameterComment(ls_Procedure As String) As String
'------------------------------------------------------------------------
' Construct the request string for a comment (Quot_CommentLine)
'------------------------------------------------------------------------
Dim ls_Req As String

    ls_Req = "exec " & ls_Procedure & " " & mi_QuotCode & "," & mi_Version & "," & mi_Line
    If MCombo_GetCode(cbo_comment) = "None" Or cbo_comment.ListIndex = -1 Then
        ls_Req = ls_Req & ",Null"
    Else
        ls_Req = ls_Req & "," & MCombo_GetCode(cbo_comment)
    End If
    ls_Req = ls_Req & ",'" & QuoteParam(txt_comment.Text) & "'"
    If chk_printed = 1 Then ls_Req = ls_Req & ",'Y'" Else ls_Req = ls_Req & ",'N'"
    ls_Req = ls_Req & ",'','',Null"
    ParameterComment = ls_Req
End Function

Private Function ParameterNew(ls_Procedure As String) As String
'--------------------------------------------------------------------
' Construct the request string for an new product (Quot_NewProduct)
'--------------------------------------------------------------------
Dim ls_Req As String

    ls_Req = "exec " & ls_Procedure & " " & mi_QuotCode & "," & mi_Version & "," & mi_Line
    If MCombo_GetCode(cbo_category) = "None" Or cbo_category.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_category) & "'"
    If MCombo_GetCode(cbo_edgeLength) = "None" Or cbo_edgeLength.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_edgeLength) & "'"
    If MCombo_GetCode(cbo_EdgeWidth) = "None" Or cbo_EdgeWidth.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_EdgeWidth) & "'"
    If MCombo_GetCode(cbo_family) = "None" Or cbo_family.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_family) & "'"
    If MCombo_GetCode(cbo_surface) = "None" Or cbo_surface.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_surface) & "'"
    If MCombo_GetCode(cbo_segmentation) = "None" Or cbo_segmentation.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_segmentation) & "'"
    If MCombo_GetCode(cbo_color) = "None" Or cbo_color.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & ",'" & MCombo_GetCode(cbo_color) & "'"
    ls_Req = ls_Req & ",'" & QuoteParam(txt_NewProductSAPCode) & "'"
    ls_Req = ls_Req & ",'" & QuoteParam(txt_Fire) & "'"
    If txt_Width = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Width
    If txt_Length = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Length
    If txt_NominalWidth = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_NominalWidth
    If txt_NominalLength = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_NominalLength
    If txt_Height = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Height
    If txt_Thickness = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Thickness
    If txt_Weight = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_Weight
    ls_Req = ls_Req & ",'" & QuoteParam(txt_GridType) & "'"
    If txt_CartonWeigth = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_CartonWeigth
    If txt_PiecePercarton = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_PiecePercarton
    If txt_SurfCtnNominal = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_SurfCtnNominal
    If txt_SurfCtnActual = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_SurfCtnActual
    ls_Req = ls_Req & ",'','',Null"
    ParameterNew = ls_Req
End Function

Private Function ParameterMetal(ls_Procedure As String) As String
'--------------------------------------------------------------------
' Construct the request string for a metal product (Quot_MetalProduct)
'--------------------------------------------------------------------
Dim ls_Req As String

    ls_Req = "exec " & ls_Procedure & " " & mi_QuotCode & "," & mi_Version & "," & mi_Line
    ls_Req = ls_Req & ",'" & txt_BISAPCode & "'"
    ls_Req = ls_Req & ",'" & txt_Panel & "'"
    ls_Req = ls_Req & ",'" & txt_FaceSize & "'"
    If txt_TileCost = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_TileCost
    If txt_TileSetUp = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_TileSetUp
    If txt_DetailCost = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_DetailCost
    If txt_DetailSetUp = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_DetailSetUp
    If txt_AcousticCost = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_AcousticCost
    If txt_AcousticSetUp = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_AcousticSetUp
    If txt_SurfacePerPiece = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_SurfacePerPiece
    If txt_PiecePerCtn = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_PiecePerCtn
    If txt_SurfacePerCarton = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_SurfacePerCarton
    If txt_CartonWeight = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_CartonWeight
    If txt_CartonPerPallet = "" Then ls_Req = ls_Req & ",null" Else ls_Req = ls_Req & "," & txt_CartonPerPallet
    ls_Req = ls_Req & ",Null"
    If MCombo_GetCode(cbo_Gasket) = "None" Or cbo_Gasket.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_Gasket)
    If MCombo_GetCode(cbo_Material) = "None" Or cbo_Material.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_Material)
    If MCombo_GetCode(cbo_Finish) = "None" Or cbo_Finish.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_Finish)
    If MCombo_GetCode(cbo_Perforation) = "None" Or cbo_Perforation.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_Perforation)
    If MCombo_GetCode(cbo_Border) = "None" Or cbo_Border.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_Border)
    If MCombo_GetCode(cbo_System) = "None" Or cbo_System.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_System)
    If MCombo_GetCode(cbo_AcousticInFill) = "None" Or cbo_AcousticInFill.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_AcousticInFill)
    If MCombo_GetCode(cbo_EdgeTop) = "None" Or cbo_EdgeTop.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_EdgeTop)
    If MCombo_GetCode(cbo_EdgeBottom) = "None" Or cbo_EdgeBottom.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_EdgeBottom)
    If MCombo_GetCode(cbo_EdgeLeft) = "None" Or cbo_EdgeLeft.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_EdgeLeft)
    If MCombo_GetCode(cbo_EdgeRight) = "None" Or cbo_EdgeRight.ListIndex = -1 Then ls_Req = ls_Req & ",Null" Else ls_Req = ls_Req & "," & MCombo_GetCode(cbo_EdgeRight)
    ls_Req = ls_Req & ",'','',Null"
    ParameterMetal = ls_Req
End Function

Function QuantityOverflow(ls_Quantity1 As String, ls_Quantity2 As String) As Boolean
'-------------------------------------------------------
' Test if quantity overflows on percentage
'-------------------------------------------------------
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Req As String
Dim ls_Data As String
On Error GoTo suite
    ls_Req = "EXEC Quot_QuantityPercentage " & ls_Quantity1 & "," & ls_Quantity2
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQL_SUCCESS
    Else
        li_Status = SQL_ERROR
    End If
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            ls_Data = ODBCData(ll_Statement, 1)
        End If
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    End If
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    If ls_Data = "KO" Then
        QuantityOverflow = KO
    Else
        QuantityOverflow = OK
    End If
    Exit Function
suite:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    GetQuantityPercent = KO
    StdError
End Function

Function Control() As Boolean
'------------------------------------------------------------------------
' Test the validity of all frames (mandatory values and numeric vbalues)
'------------------------------------------------------------------------
Dim lo_Component As Object
    ' Verify CDate fields
    '-------------------------
    If txt_promisedShipping.Enabled Then
        If txt_promisedShipping.isDateEntered Then
            If Not (txt_promisedShipping.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_promisedShipping.SetFocus
                Control = KO
                Exit Function
            End If
        End If
    End If
    If txt_PlannedProduction.Enabled Then
        If txt_PlannedProduction.isDateEntered Then
            If Not (txt_PlannedProduction.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_PlannedProduction.SetFocus
                Control = KO
                Exit Function
            End If
        End If
    End If
    ' Test validity of numeric values for common frame
    '-------------------------------------------------
    Set lo_Component = Nothing
    If Not CheckNumericValue(txt_LeadTime.Text) Then Set lo_Component = txt_LeadTime
    If Not CheckNumericValue(txt_Price.Text) Then Set lo_Component = txt_Price
    If Not CheckNumericValue(txt_stdPrice.Text) Then Set lo_Component = txt_stdPrice
    If Not CheckNumericValue(txt_Quantity.Text) Then Set lo_Component = txt_Quantity
    If TypeName(lo_Component) <> "Nothing" Then
        lo_Component.SetFocus
        SendMessage 18, "Only numeric field is valid ", gut_LangLogin.Code
        Control = KO
        Exit Function
    End If
    ' Test if quantity hasn't change too much
    '------------------------------------------
    If ms_Action = "Update" And gi_QuotationStatusCode <> Quotation_Status.opened And txt_Quantity <> "" Then
        If QuantityOverflow(ms_QLQuantity, txt_Quantity) = KO Then
            If txt_Quantity.Enabled = OK Then txt_Quantity.SetFocus
            SendMessage 123, "Overflow on quantity regarding percentage allowed", gut_LangLogin.Code
            Control = KO
            Exit Function
        End If
    End If
    
    ' Test if mandatory fields are ok
    '----------------------------------
    If txt_stdPrice <> "" And (MCombo_GetCode(cbo_currency) = "None" Or cbo_currency.ListIndex = -1) Then Set lo_Component = cbo_currency
    If txt_Quantity = "" And txt_Price <> "" Then Set lo_Component = txt_Quantity
    If ms_Type = "BaseItem" Or ms_Type = "New" Or ms_Type = "Metal" Then
            If txt_Quantity = "" Then Set lo_Component = txt_Quantity
            If MCombo_GetCode(cbo_unitOfMesure) = "None" Or cbo_unitOfMesure.ListIndex = -1 Then Set lo_Component = cbo_unitOfMesure
    End If
    If txt_Quantity <> "" And (MCombo_GetCode(cbo_unitOfMesure) = "None" Or cbo_unitOfMesure.ListIndex = -1) Then Set lo_Component = cbo_unitOfMesure
    If txt_Quantity = "" And MCombo_GetCode(cbo_unitOfMesure) <> "None" And cbo_unitOfMesure.ListIndex <> -1 Then Set lo_Component = txt_Quantity
    If ms_Type = "New" Or ms_Type = "Metal" Or ms_Type = "BaseItem" Then
            If MCombo_GetCode(cbo_Plant) = "None" Or cbo_Plant.ListIndex = -1 Then Set lo_Component = cbo_Plant
            If ms_Type <> "BaseItem" And txt_LineDesc = "" Then Set lo_Component = txt_LineDesc
    End If
    If TypeName(lo_Component) <> "Nothing" Then
        lo_Component.SetFocus
        SendMessage 8, "Value must be filled in", gut_LangLogin.Code
        Control = KO
        Exit Function
    End If
    ' Test the validity of the current frame
    '------------------------------------------
    Control = OK
    Select Case ms_Type
        Case "Comment":
            If ControlComment = KO Then Control = KO
        Case "BaseItem":
            If ControlProduct = KO Then Control = KO
        Case "New":
            If ControlNew = KO Then Control = KO
        Case "Metal":
            If ControlMetal = KO Then Control = KO
    End Select

End Function

Function ControlComment() As Boolean
'---------------------------------------------------------------
' Test the validity of all fields in the comment line frame
'---------------------------------------------------------------
    ' Verify CDate fields
    '-------------------------
    If txt_promisedShipping.Enabled Then
        If txt_promisedShipping.isDateEntered Then
            If Not (txt_promisedShipping.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_promisedShipping.SetFocus
                ControlComment = KO
                Exit Function
            End If
        End If
    End If
    If txt_PlannedProduction.Enabled Then
        If txt_PlannedProduction.isDateEntered Then
            If Not (txt_PlannedProduction.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_PlannedProduction.SetFocus
                ControlComment = KO
                Exit Function
            End If
        End If
    End If
    ' Create the description
    '-----------------------
    If cbo_comment.value <> "" And txt_comment.Text <> "" Then
        txt_LineDesc = cbo_comment.value & " - " & left(txt_comment.Text, 255)
    Else
        txt_LineDesc = cbo_comment.value & left(txt_comment.Text, 255)
    End If
    ' Verify mandatory fields
    '-------------------------
    If txt_comment = "" And (MCombo_GetCode(cbo_comment) = "None" Or cbo_comment.ListIndex = -1) Then
        cbo_comment.SetFocus
        SendMessage 8, "Value must be filled in", gut_LangLogin.Code
        ControlComment = KO
    Else
        ControlComment = OK
    End If
End Function

Function ControlProduct() As Boolean
'---------------------------------------------------------------
' Test the validity of all fields in the existing product frame
'---------------------------------------------------------------
    ' Verify CDate fields
    '-------------------------
    If txt_promisedShipping.Enabled Then
        If txt_promisedShipping.isDateEntered Then
            If Not (txt_promisedShipping.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_promisedShipping.SetFocus
                ControlProduct = KO
                Exit Function
            End If
        End If
    End If
    If txt_PlannedProduction.Enabled Then
        If txt_PlannedProduction.isDateEntered Then
            If Not (txt_PlannedProduction.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_PlannedProduction.SetFocus
                ControlProduct = KO
                Exit Function
            End If
        End If
    End If
    ' Verify mandatory fields
    '-------------------------
    If txt_SapCode = "" Then
        txt_SapCode.SetFocus
        SendMessage 8, "Value must be filled in", gut_LangLogin.Code
        ControlProduct = KO
    Else
        ControlProduct = OK
    End If
End Function

Function ControlNew() As Boolean
'----------------------------------------------------------
' Test the validity of all fields in the new product frame
'----------------------------------------------------------
Dim lo_Component As Object
    ' Test validity of numeric values for new product frame
    '-------------------------------------------------------
    Set lo_Component = Nothing
    If Not CheckNumericValue(txt_SurfCtnActual.Text) Then Set lo_Component = txt_SurfCtnActual
    If Not CheckNumericValue(txt_SurfCtnNominal.Text) Then Set lo_Component = txt_SurfCtnNominal
    If Not CheckNumericValue(txt_PiecePercarton.Text) Then Set lo_Component = txt_PiecePercarton
    If Not CheckNumericValue(txt_CartonWeigth.Text) Then Set lo_Component = txt_CartonWeigth
    If Not CheckNumericValue(txt_Weight.Text) Then Set lo_Component = txt_Weight
    If Not CheckNumericValue(txt_Thickness.Text) Then Set lo_Component = txt_Thickness
    If Not CheckNumericValue(txt_Height.Text) Then Set lo_Component = txt_Height
    If Not CheckNumericValue(txt_Width.Text) Then Set lo_Component = txt_Width
    If Not CheckNumericValue(txt_Length.Text) Then Set lo_Component = txt_Length
    If Not CheckNumericValue(txt_NominalWidth.Text) Then Set lo_Component = txt_NominalWidth
    If Not CheckNumericValue(txt_NominalLength.Text) Then Set lo_Component = txt_NominalLength
    If TypeName(lo_Component) <> "Nothing" Then
        lo_Component.SetFocus
        SendMessage 18, "Only numeric field is valid ", gut_LangLogin.Code
        ControlNew = KO
        Exit Function
    End If
    ' Verify CDate fields
    '-------------------------
    If txt_promisedShipping.Enabled Then
        If txt_promisedShipping.isDateEntered Then
            If Not (txt_promisedShipping.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_promisedShipping.SetFocus
                ControlNew = KO
                Exit Function
            End If
        End If
    End If
    If txt_PlannedProduction.Enabled Then
        If txt_PlannedProduction.isDateEntered Then
            If Not (txt_PlannedProduction.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_PlannedProduction.SetFocus
                ControlNew = KO
                Exit Function
            End If
        End If
    End If
    ' Verify Mandatory fields
    '-------------------------
    If txt_NominalWidth = "" Then Set lo_Component = txt_NominalWidth
    If txt_NominalLength = "" Then Set lo_Component = txt_NominalLength
    ' If cbo_color.Code = "None" Or cbo_color.ListIndex = -1 Then Set lo_Component = cbo_color
    ' If cbo_segmentation.Code = "None" Or cbo_segmentation.ListIndex = -1 Then Set lo_Component = cbo_segmentation
    ' If cbo_surface.Code = "None" Or cbo_surface.ListIndex = -1 Then Set lo_Component = cbo_surface
    If MCombo_GetCode(cbo_family) = "None" Or cbo_family.ListIndex = -1 Then Set lo_Component = cbo_family
    If MCombo_GetCode(cbo_category) = "None" Or cbo_category.ListIndex = -1 Then Set lo_Component = cbo_category
    If TypeName(lo_Component) <> "Nothing" Then
        lo_Component.SetFocus
        SendMessage 8, "Value must be filled in", gut_LangLogin.Code
        ControlNew = KO
        Exit Function
    End If
    ' Verify Other Mandatory fields
    '-------------------------
    If (txt_Width = "" Or txt_Length = "") And txt_GridType = "" Then
        Set lo_Component = txt_Width
    End If
    If TypeName(lo_Component) <> "Nothing" Then
        lo_Component.SetFocus
        SendMessage 147, "Value must be filled in", gut_LangLogin.Code
        ControlNew = KO
        Exit Function
    End If
    ControlNew = OK
End Function

Function ControlMetal() As Boolean
'----------------------------------------------------------
' Test the validity of all fields in the new product frame
'----------------------------------------------------------
Dim lo_Component As Object
    ' Verify CDate fields
    '-------------------------
    If txt_promisedShipping.Enabled Then
        If txt_promisedShipping.isDateEntered Then
            If Not (txt_promisedShipping.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_promisedShipping.SetFocus
                ControlMetal = KO
                Exit Function
            End If
        End If
    End If
    If txt_PlannedProduction.Enabled Then
        If txt_PlannedProduction.isDateEntered Then
            If Not (txt_PlannedProduction.isDateValid) Then
                SendMessage 131, "Invalid Date.", gut_LangLogin.Code
                txt_PlannedProduction.SetFocus
                ControlMetal = KO
                Exit Function
            End If
        End If
    End If
    ' Test validity of numeric values for new product frame
    '-------------------------------------------------------
    Set lo_Component = Nothing
    If Not CheckNumericValue(txt_CartonPerPallet.Text) Then Set lo_Component = txt_CartonPerPallet
    If Not CheckNumericValue(txt_CartonWeight.Text) Then Set lo_Component = txt_CartonWeight
    If Not CheckNumericValue(txt_SurfacePerCarton.Text) Then Set lo_Component = txt_SurfacePerCarton
    If Not CheckNumericValue(txt_PiecePerCtn.Text) Then Set lo_Component = txt_PiecePerCtn
    If Not CheckNumericValue(txt_SurfacePerPiece.Text) Then Set lo_Component = txt_SurfacePerPiece
    If Not CheckNumericValue(txt_AcousticSetUp.Text) Then Set lo_Component = txt_AcousticSetUp
    If Not CheckNumericValue(txt_AcousticCost.Text) Then Set lo_Component = txt_AcousticCost
    If Not CheckNumericValue(txt_DetailSetUp.Text) Then Set lo_Component = txt_DetailSetUp
    If Not CheckNumericValue(txt_DetailCost.Text) Then Set lo_Component = txt_DetailCost
    If Not CheckNumericValue(txt_TileSetUp.Text) Then Set lo_Component = txt_TileSetUp
    If Not CheckNumericValue(txt_TileCost.Text) Then Set lo_Component = txt_TileCost
    If TypeName(lo_Component) <> "Nothing" Then
        lo_Component.SetFocus
        SendMessage 18, "Only numeric field is valid ", gut_LangLogin.Code
        ControlMetal = KO
        Exit Function
    End If
    ControlMetal = OK
End Function


Function TestPlantValidation() As Boolean
'----------------------------------------------------------------
' Test if all plants have validated their lines for confirmation
'----------------------------------------------------------------
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Req As String
Dim ls_Data As String
On Error GoTo suite
    ls_Req = "EXEC quot_line_plantconfirmation " & mi_QuotCode & "," & mi_Version
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQL_SUCCESS
    Else
        li_Status = SQL_ERROR
    End If
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            ls_Data = ODBCData(ll_Statement, 1)
        End If
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    End If
    If ls_Data = "OK" Then
        TestPlantValidation = OK
    Else
        TestPlantValidation = KO
    End If
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Function
suite:
    TestPlantValidation = KO
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Function

Function TestPlantRefused() As Boolean
'----------------------------------------------------------------
' Test if one plant is refused
'----------------------------------------------------------------
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Req As String
Dim ls_Data As String
On Error GoTo suite
    ls_Req = "EXEC quot_line_plantrefused " & mi_QuotCode & "," & mi_Version
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQL_SUCCESS
    Else
        li_Status = SQL_ERROR
    End If
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            ls_Data = ODBCData(ll_Statement, 1)
        End If
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    End If
    If ls_Data = "OK" Then
        TestPlantRefused = OK
    Else
        TestPlantRefused = KO
    End If
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Function
suite:
    TestPlantRefused = KO
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Function

Function TestPlantOrdered() As Boolean
'----------------------------------------------------------
' Test if all plants have validated their lines for orderd
'----------------------------------------------------------
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Req As String
Dim ls_Data As String
On Error GoTo suite
    ls_Req = "EXEC quot_line_plantOrdered " & mi_QuotCode & "," & mi_Version
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQL_SUCCESS
    Else
        li_Status = SQL_ERROR
    End If
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            ls_Data = ODBCData(ll_Statement, 1)
        End If
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    End If
    If ls_Data = "OK" Then
        TestPlantOrdered = OK
    Else
        TestPlantOrdered = KO
    End If
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Function
suite:
    TestPlantOrdered = KO
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Function

Private Sub CreateRequest()
'-----------------------------------------------------------------------------------
' select, construct and execute the request for updating, adding or deleting a line
'-----------------------------------------------------------------------------------
Dim ls_request1 As String
Dim ls_request2 As String
Dim lb_cancel As Boolean
On Error GoTo suite

    lb_cancel = KO
    
    ' Select and construct the request
    '---------------------------------
    Select Case ms_Action
        ' ADDING
        Case "Add":     ls_request1 = ParameterLine("quot_line_ins")
                        Select Case ms_Type
                            Case "BaseItem": ls_request2 = ParameterProduct("Quot_Product_ins")
                            Case "Comment": ls_request2 = ParameterComment("Quot_CommentLine_ins")
                            Case "New": ls_request2 = ParameterNew("Quot_NewProduct_ins")
                            Case "Metal": ls_request2 = ParameterMetal("Quot_MetalProduct_ins")
                        End Select
        'UPDATING
        Case "Update": ls_request1 = ParameterLine("quot_line_upd") & "," & mi_Line & "," & mi_iConcurrency
                       Select Case ms_Type
                            Case "BaseItem": ls_request2 = ParameterProduct("Quot_Product_upd") & "," & mi_iConcurrency
                            Case "Comment": ls_request2 = ParameterComment("Quot_CommentLine_upd") & "," & mi_iConcurrency
                            Case "New": ls_request2 = ParameterNew("Quot_NewProduct_upd") & "," & mi_iConcurrency
                            Case "Metal": ls_request2 = ParameterMetal("Quot_MetalProduct_upd") & "," & mi_iConcurrency
                       End Select
        ' DELETING
         Case "Delete": MouseOn
                        If SendMessage(5, "Delete record ?", gut_LangLogin.Code, vbQuestion + vbYesNo, "Delete ") = vbYes Then
                            MouseOff
                            Select Case ms_Type
                                Case "BaseItem": ls_request1 = "exec quot_product_del " & mi_QuotCode & "," & mi_Version & "," & mi_Line
                                Case "Comment": ls_request1 = "exec quot_commentline_del " & mi_QuotCode & "," & mi_Version & "," & mi_Line
                                Case "New": ls_request1 = "exec quot_NewProduct_del " & mi_QuotCode & "," & mi_Version & "," & mi_Line
                                Case "Metal": ls_request1 = "exec quot_MetalProduct_del " & mi_QuotCode & "," & mi_Version & "," & mi_Line
                            End Select
                            ls_request2 = "exec quot_line_del " & mi_QuotCode & "," & mi_Version & "," & mi_Line
                        Else
                            lb_cancel = OK
                        End If
    End Select
    
    If lb_cancel = KO Then
        ' Execute the request
        '---------------------
        If BeginTran(gl_Environment, gl_Database) Then
            li_Status = ExecuteRequest(ls_request1)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then li_Status = ExecuteRequest(ls_request2)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                CommitTran gl_Environment, gl_Database
            Else
                RollbackTran gl_Environment, gl_Database
            End If
        End If
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            ' Update the parent grid with the new values
            '---------------------------------------------
            RefreshGrid
            ' Test if the plant has confirmed or validated order
            '----------------------------------------------------
            If ms_Action = "Update" And gi_QuotationStatusCode = Quotation_Status.Waiting_Plant_Confirmation Then
                If opt_PlantNo.value = OK Then
                    Quotation_ChangeStatus mi_QuotCode, mi_Version, 4
                    ' Refresh header
                    Quotation_Refresh Quot_Line_View.txt_Status, Quot_Line_View.cbo_Version, Quot_Line_View.left, Quot_Line_View.top
                Else
                    If TestPlantValidation = OK Then
                        Quotation_ChangeStatus mi_QuotCode, mi_Version, 3
                        ExecuteRequest "Quotation_upd1 " & mi_QuotCode & "," & mi_Version
                        ' Refresh header
                        Quotation_Refresh Quot_Line_View.txt_Status, Quot_Line_View.cbo_Version, Quot_Line_View.left, Quot_Line_View.top
                    End If
                End If
            Else
                If ms_Action = "Update" And gi_QuotationStatusCode = Quotation_Status.Refused_Notify_customer Then
                    If TestPlantRefused = OK Then
                        Quotation_DeleteStatus mi_QuotCode, mi_Version, 4
                        If TestPlantValidation = OK Then
                            Quotation_ChangeStatus mi_QuotCode, mi_Version, 3
                            ExecuteRequest "Quotation_upd1 " & mi_QuotCode & "," & mi_Version
                        End If
                        ' Refresh header
                        Quotation_Refresh Quot_Line_View.txt_Status, Quot_Line_View.cbo_Version, Quot_Line_View.left, Quot_Line_View.top
                    End If
                End If
            End If
            If gi_QuotationStatusCode = Quotation_Status.Ordered_to_plant Then
                If TestPlantOrdered = OK Then
                        Quotation_ChangeStatus mi_QuotCode, mi_Version, 8
                        ' Refresh header
                        Quotation_Refresh Quot_Line_View.txt_Status, Quot_Line_View.cbo_Version, Quot_Line_View.left, Quot_Line_View.top
                End If
            End If
        End If
    End If
    Exit Sub
suite:
    StdError
End Sub


Public Function ExecuteRequest(ls_Req As String) As Integer
'----------------------------------------------------------
' Send the request ls_req to the server
'----------------------------------------------------------
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ll_lngrows As Long
On Error GoTo suite
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQLRowCount(ll_Statement, ll_lngrows)
        If ll_lngrows = 0 Then
            SendMessage 2, "Another user change the record", gut_LangLogin.Code
            li_Status = SQL_ERROR
        Else
            If ms_Action = "Add" Then
                li_Status = SQLFetch(ll_Statement)
                If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                    mi_Line = ODBCData(ll_Statement, 1)
                    mi_iConcurrency = ODBCData(ll_Statement, 2)
                End If
            End If
            li_Status = SQL_SUCCESS
        End If
    Else
        Select Case ms_Action
            Case "Update": SendMessage 3, "Update failed", gut_LangLogin.Code
            Case "Delete": SendMessage 6, "Delete failed", gut_LangLogin.Code
            Case "Add": SendMessage 4, "Insert failed", gut_LangLogin.Code
        End Select
        li_Status = SQL_ERROR
    End If
    ExecuteRequest = li_Status
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Function
suite:
    ExecuteRequest = li_Status
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Function

Public Sub RefreshGrid()
'--------------------------------------------
' Refresh the parent grid
'--------------------------------------------
Dim ls_Line As String
Dim li_Row As Integer

On Error GoTo suite:
    If ms_Action = "Update" Then mi_iConcurrency = mi_iConcurrency + 1
    ls_Line = mi_QuotCode & Chr(9) & mi_Version & Chr(9) & mi_Line & Chr(9) & mi_iConcurrency & Chr(9) & _
              txt_LineDesc & Chr(9) & ms_Type & Chr(9) & 0 & Chr(9) & MCombo_GetCode(cbo_unitOfMesure) & Chr(9) & txt_Quantity & Chr(9) & txt_stdPrice & Chr(9) & txt_Price & Chr(9) & _
              txt_Amount & Chr(9) & "W" & Chr(9) & txt_LeadTime & Chr(9) & txt_promisedShipping.GetFrDate & Chr(9) & txt_PlannedProduction.GetFrDate & Chr(9) & _
              MCombo_GetCode(cbo_Plant) & Chr(9) & cbo_Plant.value
    If opt_PlantYes.value = OK Then
        ls_Line = ls_Line & Chr(9) & "Y"
    Else
        If opt_PlantNo.value = OK Then
            ls_Line = ls_Line & Chr(9) & "N"
        Else
            ls_Line = ls_Line & Chr(9) & ""
        End If
    End If
    If chk_OrderConfirmation.value = 1 Then
        ls_Line = ls_Line & Chr(9) & "Y"
    Else
        ls_Line = ls_Line & Chr(9) & ""
    End If
    ls_Line = ls_Line & Chr(9) & "" & Chr(9) & ""
    If gi_QuotationStatusCode = Quotation_Status.opened Then
        If txt_Quantity = "" Then ls_Line = ls_Line & Chr(9) & "" Else ls_Line = ls_Line & Chr(9) & txt_Quantity
    Else
        If ms_QLQuantity = "" Then ls_Line = ls_Line & Chr(9) & "" Else ls_Line = ls_Line & Chr(9) & ms_QLQuantity
    End If
    ls_Line = ls_Line & Chr(9) & MCombo_GetCode(cbo_currency)
    
    Select Case ms_Action
        Case "Add":     Quot_Line_View.Grid.AddItem ls_Line
                        If gl_NbLineDisplay <= 2 Then Quot_Line_View.FillGrid
                        gb_Return = OK
        Case "Update":  li_Row = Quot_Line_View.Grid.Row
                        Quot_Line_View.Grid.RemoveItem li_Row
                        Quot_Line_View.Grid.AddItem ls_Line, li_Row
                        gb_Return = OK
        Case "Delete":  Quot_Line_View.Grid.RemoveItem Quot_Line_View.Grid.Row
                        gb_Return = OK
        Case Else:      gb_Return = KO
    End Select
    Exit Sub
suite:
    If Err = 30015 Then
        Quot_Line_View.FillGrid
    Else
        StdError
    End If
End Sub

Private Sub txt_SapCode_LostFocus()
Dim ls_Req As String
Dim li_Status As Integer
Dim ll_Statement As Long
Dim lb_OK As String
Dim lb_Exist As Boolean
Dim lb_SaveClick As Boolean

    mb_SAPLostFocus = OK
    lb_SaveClick = KO
    
    If LCase(Me.ActiveControl.Name) = "ssc_quit" Or LCase(Me.ActiveControl.Name) = "pic_sapsearch" Then Exit Sub
    If LCase(Me.ActiveControl.Name) = "ssc_save" Then lb_SaveClick = OK
    If txt_SapCode.Text = "" Then
        txt_LineDesc = ""
        Exit Sub
    End If
        
    txt_SapCode.Text = UCase(txt_SapCode.Text)

    MouseOff

    cbo_unitOfMesure_DropButtonClick
    
    ' Get the description
    On Error GoTo suite
    lb_Exist = KO
    ls_Req = "exec Base_Item_Desc_t_sel '" & txt_SapCode.Text & "','" & ms_QuotationLanguage & "'"
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQL_SUCCESS
        Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or _
               li_Status = SQL_SUCCESS_WITH_INFO Then
                lb_Exist = OK
                txt_LineDesc = txt_SapCode.Text & ": " & ODBCData(ll_Statement, 1)
                If ODBCData(ll_Statement, 2) = "Y" Then
                    SendMessage 133, "Warning: This CLS Item is dropped", gut_LangLogin.Code, vbOKOnly
                End If
                MCombo_CodeSelect(cbo_unitOfMesure) = UCase(ODBCData(ll_Statement, 3))
            End If
        Loop
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Else
        li_Status = SQL_ERROR
    End If
    

    MouseOn
    
    mb_SAPLostFocus = KO
    If lb_Exist = KO Or li_Status = SQL_ERROR Then
        SendMessage 93, "Item code does'nt exist", gut_LangLogin.Code
        txt_SapCode.SetFocus
    Else
        If lb_SaveClick = OK Then ssc_save_Click
    End If
    
    Exit Sub
    
suite:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    mb_SAPLostFocus = KO
    StdError
    MouseOn
End Sub

