VERSION 5.00
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Begin VB.Form BaseItem_mtnc 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Base Item Maintenance"
   ClientHeight    =   7125
   ClientLeft      =   180
   ClientTop       =   195
   ClientWidth     =   9150
   ControlBox      =   0   'False
   Icon            =   "BI_MTNC.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   7125
   ScaleWidth      =   9150
   Begin VB.CheckBox chk_EstimateFlag 
      Alignment       =   1  'Right Justify
      Caption         =   "Estimate"
      ForeColor       =   &H00000000&
      Height          =   252
      Left            =   6375
      TabIndex        =   87
      Top             =   6510
      Width           =   1992
   End
   Begin VB.CheckBox chk_IsASProduct 
      Caption         =   "#AS Product"
      Height          =   255
      Left            =   3060
      TabIndex        =   80
      Top             =   5325
      Width           =   1575
   End
   Begin VB.TextBox txt_Gauge 
      BackColor       =   &H00FFFFFF&
      ForeColor       =   &H00000000&
      Height          =   288
      Left            =   1860
      TabIndex        =   18
      Top             =   5310
      Width           =   984
   End
   Begin VB.PictureBox Pic_Dropped 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0C0C0&
      BorderStyle     =   0  'None
      FillColor       =   &H00FFFFFF&
      ForeColor       =   &H80000008&
      Height          =   345
      Left            =   3615
      ScaleHeight     =   345
      ScaleWidth      =   375
      TabIndex        =   76
      Top             =   6705
      Width           =   375
   End
   Begin VB.PictureBox Pic_Launch 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0C0C0&
      BorderStyle     =   0  'None
      FillColor       =   &H00FFFFFF&
      ForeColor       =   &H80000008&
      Height          =   345
      Left            =   3615
      ScaleHeight     =   345
      ScaleWidth      =   375
      TabIndex        =   75
      Top             =   6345
      Width           =   375
   End
   Begin VB.ListBox lst_toolbox 
      ForeColor       =   &H00000000&
      Height          =   2595
      ItemData        =   "BI_MTNC.frx":030A
      Left            =   615
      List            =   "BI_MTNC.frx":030C
      TabIndex        =   0
      Top             =   390
      Visible         =   0   'False
      Width           =   1932
   End
   Begin VB.TextBox txt_InternetDesc 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00000000&
      Height          =   288
      Left            =   4500
      Locked          =   -1  'True
      TabIndex        =   73
      TabStop         =   0   'False
      Top             =   1200
      Width           =   4524
   End
   Begin VB.PictureBox ButtonBox 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   238
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   665
      Left            =   0
      ScaleHeight     =   630
      ScaleWidth      =   9120
      TabIndex        =   62
      Top             =   0
      Width           =   9150
      Begin VB.PictureBox pic_Camera 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         Height          =   480
         Left            =   1800
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   67
         Top             =   60
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.PictureBox pic_Toolbox 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   1200
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   66
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_Undo 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "BI_MTNC.frx":030E
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   660
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   65
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_Quit 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         Height          =   480
         Left            =   2400
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   64
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_Save 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "BI_MTNC.frx":0618
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   63
         Top             =   60
         Width           =   480
      End
   End
   Begin VB.Frame frm_Durable 
      Caption         =   "Durable edge"
      Height          =   552
      Left            =   4215
      TabIndex        =   61
      Top             =   6465
      Width           =   1812
      Begin VB.OptionButton optN_DurEdge 
         Caption         =   "No"
         ForeColor       =   &H00000000&
         Height          =   312
         Left            =   60
         TabIndex        =   27
         Top             =   180
         Width           =   612
      End
      Begin VB.OptionButton optY_DurEdge 
         Caption         =   "Yes"
         ForeColor       =   &H00000000&
         Height          =   312
         Left            =   1080
         TabIndex        =   28
         Top             =   180
         Width           =   612
      End
   End
   Begin VB.Frame frm_Private 
      Caption         =   "Private label"
      Height          =   612
      Left            =   4680
      TabIndex        =   35
      Top             =   2100
      Width           =   4332
      Begin VB.OptionButton Opt_No 
         Caption         =   "No"
         ForeColor       =   &H00000000&
         Height          =   312
         Left            =   60
         TabIndex        =   30
         Top             =   180
         Width           =   732
      End
      Begin VB.OptionButton Opt_yes 
         Caption         =   "Yes"
         ForeColor       =   &H00000000&
         Height          =   312
         Left            =   900
         TabIndex        =   31
         Top             =   180
         Width           =   792
      End
      Begin MSForms.ComboBox cbo_private 
         Height          =   315
         Left            =   1740
         TabIndex        =   74
         Top             =   180
         Width           =   2535
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4471;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
   End
   Begin VB.TextBox txt_short 
      BackColor       =   &H00FFFFFF&
      ForeColor       =   &H00000000&
      Height          =   288
      Left            =   1920
      MaxLength       =   10
      TabIndex        =   2
      Top             =   1200
      Width           =   1212
   End
   Begin VB.TextBox txt_Category 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00000000&
      Height          =   288
      Left            =   6408
      Locked          =   -1  'True
      TabIndex        =   33
      TabStop         =   0   'False
      Top             =   780
      Width           =   2604
   End
   Begin VB.TextBox txt_dropped 
      ForeColor       =   &H00000000&
      Height          =   315
      Left            =   1875
      Locked          =   -1  'True
      TabIndex        =   26
      Top             =   6705
      Width           =   1812
   End
   Begin VB.TextBox txt_launch 
      ForeColor       =   &H00000000&
      Height          =   315
      Left            =   1875
      Locked          =   -1  'True
      TabIndex        =   25
      Top             =   6345
      Width           =   1812
   End
   Begin VB.ComboBox cbo_drawn 
      ForeColor       =   &H00000000&
      Height          =   315
      Left            =   8115
      Style           =   2  'Dropdown List
      TabIndex        =   34
      TabStop         =   0   'False
      Top             =   6165
      Visible         =   0   'False
      Width           =   852
   End
   Begin VB.TextBox txt_desc 
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   315
      Left            =   1920
      TabIndex        =   3
      Top             =   1620
      Width           =   7092
   End
   Begin VB.TextBox txt_sap 
      BackColor       =   &H00FFFFFF&
      ForeColor       =   &H00000000&
      Height          =   288
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   1
      Top             =   780
      Width           =   2592
   End
   Begin VB.CheckBox chk_Int 
      Alignment       =   1  'Right Justify
      Caption         =   "Internet"
      ForeColor       =   &H00000000&
      Height          =   252
      Left            =   6375
      TabIndex        =   29
      Top             =   6795
      Width           =   1992
   End
   Begin VB.ComboBox cbo_armstrong 
      ForeColor       =   &H00000000&
      Height          =   315
      Left            =   1920
      Style           =   2  'Dropdown List
      TabIndex        =   4
      Top             =   2100
      Width           =   2592
   End
   Begin VB.ComboBox cbo_origin 
      ForeColor       =   &H00000000&
      Height          =   315
      ItemData        =   "BI_MTNC.frx":0922
      Left            =   1920
      List            =   "BI_MTNC.frx":0924
      Style           =   2  'Dropdown List
      TabIndex        =   5
      Top             =   2460
      Width           =   2592
   End
   Begin VB.Frame frm_Module 
      Height          =   552
      Left            =   60
      TabIndex        =   55
      Top             =   5565
      Width           =   8892
      Begin MSForms.ComboBox cbo_size 
         Height          =   315
         Left            =   6300
         TabIndex        =   24
         Top             =   180
         Width           =   2535
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4471;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_measurement 
         Height          =   315
         Left            =   1800
         TabIndex        =   23
         Top             =   180
         Width           =   2595
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4577;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_size 
         Caption         =   "Size"
         Height          =   252
         Left            =   4560
         TabIndex        =   57
         Top             =   180
         Width           =   1752
      End
      Begin VB.Label lbl_measurement 
         Caption         =   "Measurement"
         Height          =   255
         Left            =   45
         TabIndex        =   56
         Top             =   225
         Width           =   1755
      End
   End
   Begin VB.Frame frm_Dimension 
      Height          =   552
      Left            =   60
      TabIndex        =   58
      Top             =   5565
      Width           =   8892
      Begin VB.TextBox txt_Thick 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   7500
         TabIndex        =   22
         Top             =   180
         Visible         =   0   'False
         Width           =   1000
      End
      Begin VB.TextBox txt_Height 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   7500
         TabIndex        =   21
         Top             =   180
         Width           =   1000
      End
      Begin VB.TextBox txt_Length 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   4300
         TabIndex        =   20
         Top             =   180
         Width           =   1000
      End
      Begin VB.TextBox txt_Width 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   1800
         TabIndex        =   19
         Top             =   180
         Width           =   1000
      End
      Begin VB.Label lbl_Thick 
         Caption         =   "Thickness"
         Height          =   255
         Left            =   6000
         TabIndex        =   79
         Top             =   225
         Visible         =   0   'False
         Width           =   1005
      End
      Begin VB.Label lbl_Height 
         Caption         =   "Height"
         Height          =   255
         Left            =   6000
         TabIndex        =   77
         Top             =   180
         Width           =   1000
      End
      Begin VB.Label lbl_Width 
         Caption         =   "Width"
         Height          =   252
         Left            =   120
         TabIndex        =   59
         Top             =   180
         Width           =   1000
      End
      Begin VB.Label lbl_Length 
         Caption         =   "Length"
         Height          =   252
         Left            =   3200
         TabIndex        =   60
         Top             =   180
         Width           =   1000
      End
   End
   Begin VB.Frame frm_Ceiling 
      Height          =   1275
      Left            =   120
      TabIndex        =   36
      Top             =   3900
      Width           =   8892
      Begin VB.ComboBox cbo_perf 
         ForeColor       =   &H00000000&
         Height          =   315
         Left            =   6315
         Style           =   2  'Dropdown List
         TabIndex        =   15
         Top             =   540
         Width           =   984
      End
      Begin MSForms.ComboBox cbo_perforation 
         Height          =   315
         Left            =   6315
         TabIndex        =   86
         Top             =   900
         Width           =   2490
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4392;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_Form 
         Height          =   315
         Left            =   6315
         TabIndex        =   85
         Top             =   195
         Width           =   2490
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4392;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_perforation 
         Caption         =   "#Perforation Design"
         Height          =   255
         Left            =   4605
         TabIndex        =   84
         Top             =   930
         Width           =   1710
      End
      Begin VB.Label lbl_form 
         Caption         =   "#Form"
         Height          =   255
         Left            =   4590
         TabIndex        =   83
         Top             =   240
         Width           =   1755
      End
      Begin MSForms.ComboBox cbo_shape 
         Height          =   315
         Left            =   1800
         TabIndex        =   13
         Top             =   900
         Width           =   2595
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4577;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_surf 
         Height          =   315
         Left            =   1800
         TabIndex        =   14
         Top             =   540
         Width           =   2595
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4577;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_edge 
         Height          =   315
         Left            =   1800
         TabIndex        =   12
         Top             =   180
         Width           =   2595
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4577;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_surf 
         Caption         =   "Surface"
         Height          =   255
         Left            =   60
         TabIndex        =   40
         Top             =   570
         Width           =   1755
      End
      Begin VB.Label lbl_edge 
         Caption         =   "Edge"
         Height          =   252
         Left            =   60
         TabIndex        =   39
         Top             =   204
         Width           =   1752
      End
      Begin VB.Label lbl_perf 
         Caption         =   "Fire perf."
         Height          =   255
         Left            =   4590
         TabIndex        =   37
         Top             =   570
         Width           =   1725
      End
      Begin VB.Label lbl_shape 
         Caption         =   "Shape"
         Height          =   255
         Left            =   60
         TabIndex        =   38
         Top             =   930
         Width           =   1755
      End
   End
   Begin VB.Frame frm_Grid 
      Height          =   930
      Left            =   120
      TabIndex        =   68
      Top             =   3900
      Width           =   8892
      Begin VB.TextBox txt_Weight 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   7020
         TabIndex        =   32
         Top             =   165
         Visible         =   0   'False
         Width           =   800
      End
      Begin MSForms.ComboBox cbo_componentType 
         Height          =   315
         Left            =   6210
         TabIndex        =   82
         Top             =   555
         Width           =   2625
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4630;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_componentType 
         Caption         =   "#Component type"
         Height          =   225
         Left            =   4455
         TabIndex        =   81
         Top             =   615
         Width           =   1755
      End
      Begin MSForms.ComboBox cbo_Corrosion 
         Height          =   315
         Left            =   1800
         TabIndex        =   17
         Top             =   540
         Width           =   975
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "1720;556"
         MatchEntry      =   0
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin MSForms.ComboBox cbo_Group 
         Height          =   315
         Left            =   1800
         TabIndex        =   16
         Top             =   180
         Width           =   2595
         VariousPropertyBits=   679479323
         DisplayStyle    =   7
         Size            =   "4577;556"
         MatchEntry      =   1
         ShowDropButtonWhen=   2
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
      End
      Begin VB.Label lbl_Group 
         Caption         =   "Group"
         Height          =   252
         Left            =   60
         TabIndex        =   71
         Top             =   180
         Width           =   1752
      End
      Begin VB.Label lbl_Corrosion 
         Caption         =   "Corrosion"
         Height          =   228
         Left            =   60
         TabIndex        =   70
         Top             =   600
         Width           =   1752
      End
      Begin VB.Label lbl_weight 
         Caption         =   "Weight"
         Height          =   240
         Left            =   5805
         TabIndex        =   69
         Top             =   213
         Visible         =   0   'False
         Width           =   795
      End
   End
   Begin VB.Label lbl_Gauge 
      Caption         =   "Gauge"
      Height          =   255
      Left            =   120
      TabIndex        =   78
      Top             =   5310
      Width           =   1770
   End
   Begin MSForms.ComboBox cbo_psegm 
      Height          =   315
      Left            =   6420
      TabIndex        =   11
      Top             =   3540
      Width           =   2595
      VariousPropertyBits=   679479323
      DisplayStyle    =   7
      Size            =   "4577;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin MSForms.ComboBox cbo_pattern 
      Height          =   315
      Left            =   1920
      TabIndex        =   10
      Top             =   3540
      Width           =   2595
      VariousPropertyBits=   679479323
      DisplayStyle    =   7
      Size            =   "4577;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin MSForms.ComboBox cbo_colour 
      Height          =   315
      Left            =   6420
      TabIndex        =   9
      Top             =   3180
      Width           =   2595
      VariousPropertyBits=   679479323
      DisplayStyle    =   7
      Size            =   "4577;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin MSForms.ComboBox cbo_family 
      Height          =   315
      Left            =   1920
      TabIndex        =   8
      Top             =   3180
      Width           =   2595
      VariousPropertyBits=   679479323
      DisplayStyle    =   7
      Size            =   "4577;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin MSForms.ComboBox cbo_basemat 
      Height          =   315
      Left            =   4680
      TabIndex        =   7
      Top             =   2820
      Width           =   2595
      VariousPropertyBits=   679479323
      DisplayStyle    =   7
      Size            =   "4577;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin MSForms.ComboBox cbo_SupBaseMat 
      Height          =   315
      Left            =   1920
      TabIndex        =   6
      Top             =   2820
      Width           =   2595
      VariousPropertyBits=   679495707
      DisplayStyle    =   3
      Size            =   "4577;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin VB.Label lbl_IntDesc 
      Caption         =   "Internet desc."
      Height          =   255
      Left            =   3300
      TabIndex        =   72
      Top             =   1200
      Width           =   1215
   End
   Begin VB.Label lbl_armstrong 
      Caption         =   "Armstrong product"
      Height          =   255
      Left            =   180
      TabIndex        =   54
      Top             =   2100
      Width           =   1755
   End
   Begin VB.Label lbl_origin 
      Caption         =   "Origin"
      Height          =   255
      Left            =   180
      TabIndex        =   53
      Top             =   2460
      Width           =   1755
   End
   Begin VB.Label lbl_short 
      Caption         =   "Short code"
      Height          =   255
      Left            =   180
      TabIndex        =   52
      Top             =   1200
      Width           =   1755
   End
   Begin VB.Label lbl_SAP 
      Caption         =   "Sap code"
      Height          =   255
      Left            =   180
      TabIndex        =   51
      Top             =   780
      Width           =   1755
   End
   Begin VB.Label lbl_desc 
      Caption         =   "Description"
      Height          =   255
      Left            =   180
      TabIndex        =   50
      Top             =   1620
      Width           =   1755
   End
   Begin VB.Label lbl_family 
      Caption         =   "Family"
      Height          =   255
      Left            =   180
      TabIndex        =   49
      Top             =   3180
      Width           =   1755
   End
   Begin VB.Label lbl_colour 
      Caption         =   "Colour"
      Height          =   255
      Left            =   4680
      TabIndex        =   48
      Top             =   3180
      Width           =   1755
   End
   Begin VB.Label lbl_baseMat 
      Caption         =   "Base material"
      Height          =   255
      Left            =   180
      TabIndex        =   47
      Top             =   2820
      Width           =   1755
   End
   Begin VB.Label lbl_drawn 
      Caption         =   "Drawn"
      Height          =   255
      Left            =   7395
      TabIndex        =   46
      Top             =   6210
      Visible         =   0   'False
      Width           =   735
   End
   Begin VB.Label lbl_psegm 
      Caption         =   "Product segm."
      Height          =   255
      Left            =   4680
      TabIndex        =   45
      Top             =   3540
      Width           =   1755
   End
   Begin VB.Label lbl_launch 
      Caption         =   "Launch date"
      Height          =   255
      Left            =   75
      TabIndex        =   44
      Top             =   6345
      Width           =   1755
   End
   Begin VB.Label lbl_dropp 
      Caption         =   "Drop date"
      Height          =   255
      Left            =   75
      TabIndex        =   43
      Top             =   6705
      Width           =   1815
   End
   Begin VB.Label lbl_pattern 
      Caption         =   "Pattern"
      Height          =   255
      Left            =   180
      TabIndex        =   42
      Top             =   3540
      Width           =   1755
   End
   Begin VB.Label lbl_category 
      Caption         =   "Category"
      Height          =   255
      Left            =   4680
      TabIndex        =   41
      Top             =   780
      Width           =   1755
   End
End
Attribute VB_Name = "BaseItem_mtnc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'what is new
'2.7.1 Suppor for default group (JN)
'2.7.1 bugfix - AS product rechceck on second and nex product creation (JN)

Dim ms_CopiedCode As String
Dim ms_OldLaunchDate As String
Dim ms_OldDroppedDate As String

Private Sub cbo_basemat_DropButtonClick()
    
    MouseOff
    If cbo_SupBaseMat.ListIndex <> -1 Then
        If cbo_Basemat.Tag = UNLOADED Then
            Call Load_BaseMat(gs_CGCode, MCombo_GetCode(cbo_SupBaseMat), MCombo_GetCode(cbo_Basemat))
        End If
    End If
    MouseOn

End Sub

Private Sub Load_BaseMat(ByVal as_CG_Code As String, ByVal as_SBMCode As String, ByVal as_BMCode As String)
    cbo_Basemat.Clear
    MCombo_Fill cbo_Basemat, "EXEC Base_Material_cbo2 '" & gs_CGCode & "', '" & as_SBMCode & "', 'E'"
    MCombo_CodeSelect(cbo_Basemat) = as_BMCode
    cbo_Basemat.Tag = Loaded
End Sub

Private Sub cbo_componentType_DropButtonClick()
    MouseOff
    If cbo_componentType.Tag = UNLOADED Then
        Call Load_Component_Type(gs_CGCode, MCombo_GetCode(cbo_componentType))
    End If
    MouseOn
End Sub

Private Sub cbo_edge_DropButtonClick()
    
    MouseOff
    If cbo_edge.Tag = UNLOADED Then
        Call Load_Edge(gs_CGCode, MCombo_GetCode(cbo_edge))
    End If
    MouseOn

End Sub

Private Sub Load_Edge(ByVal as_CG_Code As String, ByVal as_PECode As String)
    cbo_edge.Clear
    MCombo_Fill cbo_edge, "EXEC Products_Edges_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_edge) = as_PECode
    cbo_edge.Tag = Loaded
End Sub


Private Sub cbo_Form_DropButtonClick()
    MouseOff
    If cbo_Form.Tag = UNLOADED Then
        Call Load_Form(gs_CGCode, MCombo_GetCode(cbo_Form))
    End If
    MouseOn
End Sub

Private Sub Load_Form(ByVal as_CG_Code As String, ByVal as_Code As String)
    cbo_Form.Clear
    Call MCombo_AddItemCode(cbo_Form, "", "", False)
    MCombo_Fill cbo_Form, "EXEC Form_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_Form) = as_Code
    cbo_Form.Tag = Loaded
End Sub

Private Sub cbo_group_DropButtonClick()
    MouseOff
    If cbo_Group.Tag = UNLOADED Then
        Call Load_Products_Edges(gs_CGCode, MCombo_GetCode(cbo_Group))
    End If
    MouseOn
End Sub

Private Sub Load_Component_Type(ByVal as_CG_Code As String, ByVal as_Code As String)
    cbo_componentType.Clear
    Call MCombo_AddItemCode(cbo_componentType, "", "", False)
    MCombo_Fill cbo_componentType, "EXEC Component_Type_cbo '" & as_CG_Code & "','E'"
    
    MCombo_CodeSelect(cbo_componentType) = as_Code
    cbo_componentType.Tag = Loaded
End Sub

Private Sub Load_Products_Edges(ByVal as_CG_Code As String, ByVal as_Code As String)
    cbo_Group.Clear
    MCombo_Fill cbo_Group, "EXEC Products_Edges_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_Group) = as_Code
    cbo_Group.Tag = Loaded
End Sub

Private Sub cbo_measurement_Click()
    MouseOff
    cbo_size.ListIndex = -1
    cbo_size.Tag = UNLOADED
    If cbo_Measurement.ListIndex = -1 Then
        cbo_size.Enabled = KO
    Else
        cbo_size.Enabled = OK
    End If
    MouseOn
End Sub

Private Sub cbo_Perforation_DropButtonClick()
    MouseOff
    If cbo_Perforation.Tag = UNLOADED Then
        Call Load_Perforation(gs_CGCode, MCombo_GetCode(cbo_Perforation))
    End If
    MouseOn
End Sub

Private Sub Load_Perforation(ByVal as_CG_Code As String, ByVal as_Code As String)
    cbo_Perforation.Clear
    Call MCombo_AddItemCode(cbo_Perforation, "", "", False)
    MCombo_Fill cbo_Perforation, "EXEC Perforation_cbo '" & as_CG_Code & "','E', NULL"
    MCombo_CodeSelect(cbo_Perforation) = as_Code
    cbo_Perforation.Tag = Loaded
End Sub

Private Sub cbo_private_DropButtonClick()
    MouseOff
    If cbo_private.Tag = UNLOADED Then
        Call Load_Private_labels(gs_CGCode, MCombo_GetCode(cbo_private))
    End If
    MouseOn
End Sub

Private Sub Load_Private_labels(ByVal as_CG_Code As String, ByVal as_Code As String)
    cbo_private.Clear
    MCombo_Fill cbo_private, "EXEC Priv_Labels_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_private) = as_Code
    cbo_private.Tag = Loaded
End Sub


Private Sub cbo_armstrong_DropDown()
Dim ls_Text As String

    MouseOff
    If cbo_armstrong.Tag = UNLOADED Then
        If cbo_armstrong.ListIndex <> -1 Then
            ls_Text = cbo_armstrong
        Else
            ls_Text = ""
        End If
        Call Load_Armstrong(ls_Text)
    End If
    MouseOn

End Sub

Private Sub Load_Armstrong(ByVal as_Code As String)
    cbo_armstrong.Clear
    FillOneCbo "EXEC Dictionnary_t_lst 'Armstrong_product','E'", cbo_armstrong
    If as_Code <> "" Then
        cbo_armstrong.ListIndex = ComboFindItem(cbo_armstrong, as_Code)
    End If
    cbo_armstrong.Tag = Loaded
End Sub


Private Sub cbo_drawn_DropDown()
Dim ls_Text As String
    
    MouseOff
    If cbo_drawn.Tag = UNLOADED Then
        If cbo_drawn.ListIndex <> -1 Then
            ls_Text = cbo_drawn
        Else
            ls_Text = ""
        End If
        cbo_drawn.Clear
        FillOneCbo "EXEC Dictionnary_t_lst 'yes_no'", cbo_drawn
        If ls_Text <> "" Then
            cbo_drawn.ListIndex = ComboFindItem(cbo_drawn, ls_Text)
        End If
        cbo_drawn.Tag = Loaded
    End If
    MouseOn

End Sub

Private Sub cbo_origin_DropDown()
Dim ls_Text As String
    
    MouseOff
    If cbo_origin.Tag = UNLOADED Then
        If cbo_origin.ListIndex <> -1 Then
            ls_Text = cbo_origin
        Else
            ls_Text = ""
        End If
        Call Load_Origin(ls_Text)
    End If
    MouseOn

End Sub

Private Sub Load_Origin(ByVal as_Code As String)
    cbo_origin.Clear
    FillOneCbo "EXEC dictionnary_t_lst 'origin_type','E'", cbo_origin
    If as_Code <> "" Then
        cbo_origin.ListIndex = ComboFindItem(cbo_origin, as_Code)
    End If
    cbo_origin.Tag = Loaded
End Sub

Private Sub cbo_perf_DropDown()
Dim ls_Text As String
    
    MouseOff
    If cbo_Perf.Tag = UNLOADED Then
        If cbo_Perf.ListIndex <> -1 Then
            ls_Text = cbo_Perf
        Else
            ls_Text = ""
        End If
        Call Load_FireRating(ls_Text)
    End If
    MouseOn

End Sub

Private Sub Load_FireRating(ByVal as_Code As String)
    cbo_Perf.Clear
    FillOneCbo "EXEC Dictionnary_t_lst 'perf_ind','E'", cbo_Perf
    If as_Code <> "" Then
        cbo_Perf.ListIndex = ComboFindItem(cbo_Perf, as_Code)
    End If
    cbo_Perf.Tag = Loaded
End Sub

Private Sub cbo_measurement_DropButtonClick()
    MouseOff
    If cbo_Measurement.Tag = UNLOADED Then
        Call Load_Measurement_System(MCombo_GetCode(cbo_Measurement))
    End If
    MouseOn
End Sub

Private Sub Load_Measurement_System(ByVal as_Code As String)
    cbo_Measurement.Clear
    MCombo_Fill cbo_Measurement, "EXEC Measurement_System_cbo 'E'"
    MCombo_CodeSelect(cbo_Measurement) = as_Code
    cbo_Measurement.Tag = Loaded
End Sub

Private Sub cbo_pattern_DropButtonclick()
    
    MouseOff
    If cbo_Pattern.Tag = UNLOADED Then
        Call Load_Pattern(gs_CGCode, MCombo_GetCode(cbo_Pattern))
    End If
    MouseOn

End Sub

Private Sub Load_Pattern(ByVal as_CG_Code As String, ByVal as_PPCode As String)
    cbo_Pattern.Clear
    MCombo_Fill cbo_Pattern, "EXEC Products_Patterns_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_Pattern) = as_PPCode
    cbo_Pattern.Tag = Loaded
End Sub


Private Sub cbo_psegm_DropButtonClick()
    MouseOff
    If cbo_Psegm.Tag = UNLOADED Then
        Call Load_Products_Segmentation(gs_CGCode, MCombo_GetCode(cbo_Psegm))
    End If
    MouseOn
End Sub

Private Sub Load_Products_Segmentation(ByVal as_CG_Code As String, ByVal as_Code As String)
    cbo_Psegm.Clear
    MCombo_Fill cbo_Psegm, "EXEC Products_Segmentation_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_Psegm) = as_Code
    cbo_Psegm.Tag = Loaded
End Sub

Private Sub cbo_shape_DropButtonClick()
    MouseOff
    If cbo_Shape.Tag = UNLOADED Then
        Call Load_Shape(gs_CGCode, MCombo_GetCode(cbo_Shape))
    End If
    MouseOn

End Sub

Private Sub Load_Shape(ByVal as_CG_Code As String, ByVal as_SHcode As String)
    cbo_Shape.Clear
    MCombo_Fill cbo_Shape, "EXEC Shapes_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_Shape) = as_SHcode
    cbo_Shape.Tag = Loaded
End Sub

Private Sub cbo_size_DropButtonclick()
Dim lv_Value As Variant
    
    MouseOff
    If cbo_size.Tag = UNLOADED Then
        lv_Value = MCombo_GetCode(cbo_size)
        cbo_size.Clear
        MCombo_Fill cbo_size, "EXEC Product_Dimension_cbo3 '" _
            & MCombo_GetCode(cbo_Measurement) _
            & "', '" & gs_CGCode & "' "
        MCombo_CodeSelect(cbo_size) = lv_Value
        cbo_size.Tag = Loaded
    End If
    MouseOn

End Sub

Private Sub cbo_SupBaseMat_Click()
    
    MouseOff
    cbo_Basemat.ListIndex = -1
    cbo_Basemat.Tag = UNLOADED
    If cbo_SupBaseMat.ListIndex = -1 Then
        cbo_Basemat.Enabled = KO
    Else
        cbo_Basemat.Enabled = OK
    End If
    MouseOn
    
End Sub

Private Sub cbo_SupBaseMat_DropButtonClick()
    MouseOff
    If cbo_SupBaseMat.Tag = UNLOADED Then
        Call Load_SupBaseMat(gs_CGCode, MCombo_GetCode(cbo_SupBaseMat))
    End If
    MouseOn

End Sub

Private Sub Load_SupBaseMat(ByVal as_CG_Code As String, ByVal as_SBMCode As String)
    cbo_SupBaseMat.Clear
    MCombo_Fill cbo_SupBaseMat, "EXEC Super_Base_Material_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_SupBaseMat) = as_SBMCode
    cbo_SupBaseMat.Tag = Loaded
End Sub

Private Sub cbo_surf_DropButtonClick()
    MouseOff
    If cbo_surf.Tag = UNLOADED Then
        Call Load_Surfaces(gs_CGCode, MCombo_GetCode(cbo_surf))
    End If
    MouseOn
End Sub

Private Sub Load_Surfaces(ByVal as_CG_Code As String, ByVal as_col_Code As String)
    cbo_surf.Clear
    MCombo_Fill cbo_surf, "EXEC Surfaces_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_surf) = as_col_Code
    cbo_surf.Tag = Loaded
End Sub

Private Sub cbo_colour_DropButtonclick()
    MouseOff
    If cbo_Colour.Tag = UNLOADED Then
        Call Load_Colors(gs_CGCode, MCombo_GetCode(cbo_Colour))
    End If
    MouseOn
End Sub

Private Sub Load_Colors(ByVal as_CG_Code As String, ByVal as_col_Code As String)
    cbo_Colour.Clear
    MCombo_Fill cbo_Colour, "EXEC Colours_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_Colour) = as_col_Code
    cbo_Colour.Tag = Loaded
End Sub

Private Sub cbo_family_DropButtonClick()
    MouseOff
    If cbo_family.Tag = UNLOADED Then
        Call Load_Family(gs_CGCode, MCombo_GetCode(cbo_family))
    End If
    MouseOn
End Sub

Private Sub Load_Family(ByVal as_CG_Code As String, ByVal as_pf_code As String)
    cbo_family.Clear
    MCombo_Fill cbo_family, "EXEC Products_Families_cbo '" & as_CG_Code & "','E'"
    MCombo_CodeSelect(cbo_family) = as_pf_code
    cbo_family.Tag = Loaded
End Sub

Private Sub Form_Click()
    lst_toolbox.Visible = KO
End Sub

Private Sub Form_Load()

    On Error GoTo Form_Load_Err
    
    MouseOff
    
    ms_CopiedCode = ""
    
    If gl_CodePage <> 1252 And gl_CodePage <> 0 Then ChangeCharset Me

    pic_Camera.Picture = LoadResPicture(RES_PHOTO, 1)
    Pic_Launch.Picture = LoadResPicture(RES_COMBOCOPY, 1)
    Pic_Dropped.Picture = LoadResPicture(RES_COMBOCOPY, 1)
    If gs_Action = "Update" Then
    pic_Undo.Picture = LoadResPicture(RES_CANCEL, 1)
    Else
        pic_Undo.Visible = KO
    End If
    pic_Save.Picture = LoadResPicture(RES_OK, 1)
    pic_quit.Picture = LoadResPicture(RES_QUIT, 1)
    pic_Toolbox.Picture = LoadResPicture(RES_TOOL, 1)
    Top = 0
    Left = 0
    Select Case gs_CGCode
    Case "C001", "C006"
        frm_Ceiling.Visible = OK
        frm_Grid.Visible = KO
        If gs_BIType = "STD" Then
            frm_Module.Visible = OK
            frm_Dimension.Visible = KO
        Else
            frm_Module.Visible = KO
            frm_Dimension.Visible = OK
            lbl_Thick.Left = lbl_Height.Left
            txt_Thick.Left = txt_Height.Left
            lbl_Thick.Visible = OK
            txt_Thick.Visible = OK
            lbl_Height.Visible = KO
            txt_Height.Visible = KO
        End If
    Case Else
        frm_Ceiling.Visible = KO
        frm_Grid.Visible = OK
        frm_Dimension.Visible = OK
        frm_Module.Visible = KO
        frm_Durable.Visible = KO
    End Select
    ReadConstants
    InitCombos
    If gs_Action = "Update" Or gs_Action = "Delete" Then
        GetValues
        ms_OldLaunchDate = txt_launch.Text
        ms_OldDroppedDate = txt_dropped.Text
        If gs_BIType = "STD" Then BiMktSearch
        If gs_Action = "Delete" Then
            txt_sap.Locked = OK
            txt_short.Locked = OK
            txt_desc.Locked = OK
            cbo_armstrong.Enabled = KO
            cbo_origin.Enabled = KO
            Opt_Yes.Enabled = KO
            Opt_No.Enabled = KO
            cbo_private.Enabled = KO
            cbo_SupBaseMat.Enabled = KO
            cbo_family.Enabled = KO
            cbo_Pattern.Enabled = KO
            cbo_edge.Enabled = KO
            cbo_surf.Enabled = KO
            cbo_Colour.Enabled = KO
            cbo_Psegm.Enabled = KO
            cbo_Shape.Enabled = KO
            cbo_Measurement.Enabled = KO
            txt_Length.Locked = OK
            txt_Width.Locked = OK
            txt_Thick.Locked = OK
            cbo_Perf.Enabled = KO
            txt_Gauge.Locked = OK
            txt_launch.Locked = OK
            Pic_Launch.Visible = KO
            txt_dropped.Locked = OK
            Pic_Dropped.Visible = KO
            optY_DurEdge.Enabled = KO
            optN_DurEdge.Enabled = KO
            chk_Int.Enabled = KO
            chk_EstimateFlag.Enabled = KO
            chk_EstimateFlag.Enabled = KO
            cbo_drawn.Enabled = KO
            cbo_Group.Enabled = KO
            cbo_componentType.Enabled = KO
            txt_Height.Locked = OK
            txt_Weight.Locked = OK
            cbo_Corrosion.Enabled = KO
            cbo_Form.Enabled = KO
            cbo_Perforation.Enabled = KO
            cbo_Basemat.Enabled = KO
            cbo_size.Enabled = KO
            chk_IsASProduct.Enabled = False
        Else
            If gs_BIType = "SPC" Then
                chk_IsASProduct.Enabled = False
                chk_Int.Enabled = KO
                chk_EstimateFlag.Enabled = KO
            End If
        End If
    Else
        pic_Camera.Visible = OK
        Txt_category = BaseItem_detail.Txt_category
        txt_sap.Locked = 0
        cbo_Basemat.Enabled = KO
        cbo_size.Enabled = KO
        Opt_No.Value = OK
        optN_DurEdge.Value = OK
        cbo_drawn.AddItem "No"
        cbo_drawn.ListIndex = 0
        If gs_BIType = "SPC" Then
            txt_launch = FormatD2(Date)
            cbo_armstrong.AddItem "Yes"
            cbo_armstrong.ListIndex = 0
            cbo_origin.AddItem "Manufactured"
            cbo_origin.ListIndex = 0
            chk_IsASProduct.Value = vbChecked
            chk_IsASProduct.Enabled = False
            chk_Int.Enabled = KO
            chk_EstimateFlag.Enabled = KO
        End If
    End If
    gs_Photo = ""
    MouseOn
    Exit Sub
    
Form_Load_Err:
    MouseOn
    StdError
End Sub

Private Sub GetValues()
   
    On Error GoTo GetValues_Err
    
    txt_sap = BaseItem_detail.txt_sap
    txt_short = BaseItem_detail.txt_short
    txt_desc = BaseItem_detail.txt_desc
    txt_launch = BaseItem_detail.txt_launch
    txt_dropped = BaseItem_detail.txt_dropp_date
    Txt_category.Text = BaseItem_detail.Txt_category
    cbo_armstrong.AddItem BaseItem_detail.txt_ArmstrongCode
    cbo_armstrong.ListIndex = 0
    cbo_origin.AddItem BaseItem_detail.txt_OriginCode
    cbo_origin.ListIndex = 0
    
    MCombo_AddItemCode cbo_SupBaseMat, BaseItem_detail.txt_SBMcode, BaseItem_detail.txt_SupBaseMat
    MCombo_AddItemCode cbo_Basemat, BaseItem_detail.txt_bmcode, BaseItem_detail.txt_basemat
    MCombo_AddItemCode cbo_family, BaseItem_detail.txt_pfcode, BaseItem_detail.txt_family
    MCombo_AddItemCode cbo_Pattern, BaseItem_detail.txt_ppcode, BaseItem_detail.txt_pattern
    Select Case gs_CGCode
    Case "C001", "C006"
        MCombo_AddItemCode cbo_edge, BaseItem_detail.txt_PEcode, BaseItem_detail.txt_edge
        MCombo_AddItemCode cbo_Shape, BaseItem_detail.txt_shcode, BaseItem_detail.txt_shape
        MCombo_AddItemCode cbo_surf, BaseItem_detail.txt_sfcode, BaseItem_detail.txt_surf
        MCombo_AddItemCode cbo_Measurement, BaseItem_detail.txt_mscode, BaseItem_detail.Txt_measurement
        MCombo_AddItemCode cbo_size, BaseItem_detail.txt_szCode, BaseItem_detail.txt_size
        MCombo_AddItemCode cbo_Perforation, BaseItem_detail.txt_PRF_Id, BaseItem_detail.txt_perforationDesc
        MCombo_AddItemCode cbo_Form, BaseItem_detail.txt_FORM_Id, BaseItem_detail.txt_formDesc
        cbo_Perf.AddItem BaseItem_detail.txt_perf
        cbo_Perf.ListIndex = 0
    Case Else
        MCombo_AddItemCode cbo_Group, BaseItem_detail.txt_PEcode, BaseItem_detail.txt_Group
        txt_Height = BaseItem_detail.txt_Height
        txt_Weight = BaseItem_detail.txt_Weight
        MCombo_CodeSelect(cbo_Corrosion) = BaseItem_detail.txt_Corrosion
        MCombo_AddItemCode cbo_componentType, BaseItem_detail.txt_CPT_Id, BaseItem_detail.txt_componentTypeDesc
    End Select
    MCombo_AddItemCode cbo_Psegm, BaseItem_detail.txt_pscode, BaseItem_detail.txt_psegm
    MCombo_AddItemCode cbo_Colour, BaseItem_detail.txt_colcode, BaseItem_detail.txt_colour
    
    cbo_drawn.AddItem "No"
    cbo_drawn.ListIndex = 0
    If BaseItem_detail.txt_pvcode = "" Then
        Opt_No.Value = OK
    Else
        Opt_Yes.Value = OK
        MCombo_AddItemCode cbo_private, BaseItem_detail.txt_pvcode, BaseItem_detail.txt_PrivLabel
    End If
    txt_Length = BaseItem_detail.txt_Length
    txt_Width = BaseItem_detail.txt_Width
    txt_Thick = BaseItem_detail.txt_Thick
    txt_Gauge = BaseItem_detail.txt_Gauge
    If BaseItem_detail.txt_DurableEdge = "Yes" Then
        optY_DurEdge.Value = OK
    Else
        optN_DurEdge.Value = OK
    End If
    If BaseItem_detail.txt_IntFlag = "Yes" Then
        chk_Int.Value = 1
    Else
        chk_Int.Value = 0
    End If
    If BaseItem_detail.txt_EstimateFlag = "Yes" Then
        chk_EstimateFlag.Value = vbChecked
    Else
        chk_EstimateFlag.Value = vbUnchecked
    End If
    chk_IsASProduct.Value = BaseItem_detail.chk_IsASProduct.Value
    
    Exit Sub
    
GetValues_Err:
    StdError
End Sub


Private Sub lst_toolbox_DblClick()
Dim ls_TempCGCode As String
Dim ls_Action As String
    
    On Error GoTo lst_Toolbox_DblClick_Err
    
    MouseOff
    ls_TempCGCode = gs_CGCode
    ls_Action = gs_Action
    lst_toolbox.Visible = KO
    If lst_toolbox.ListIndex > 15 Then
        MsgBox "Too many records in toolbox. Make a call to I.T Team at Pontarlier"
        Exit Sub
    End If
    gs_MenuChoice = Txt_category
    gs_TableTitle = lst_toolbox
    Select Case lst_toolbox
    Case "Colours"
        OptColour
        cbo_Colour.ListIndex = -1
        cbo_Colour.Tag = UNLOADED
    Case "Families"
        OptFamily
        cbo_family.ListIndex = -1
        cbo_family.Tag = UNLOADED
    Case "Edges"
        OptGroup
        cbo_edge.ListIndex = -1
        cbo_edge.Tag = UNLOADED
    Case "Product group"
        OptGroup
        cbo_Group.ListIndex = -1
        cbo_Group.Tag = UNLOADED
    Case "Patterns"
        OptPattern
        cbo_Pattern.ListIndex = -1
        cbo_Pattern.Tag = UNLOADED
    Case "Surfaces"
        OptSurface
        cbo_surf.ListIndex = -1
        cbo_surf.Tag = UNLOADED
    Case "Products segmentation"
        OptSegment
        cbo_Psegm.ListIndex = -1
        cbo_Psegm.Tag = UNLOADED
    Case "Shapes"
        OptShape
        cbo_Shape.ListIndex = -1
        cbo_Shape.Tag = UNLOADED
    Case "Base material"
        OptBaseMaterial
        cbo_Basemat.ListIndex = -1
        cbo_Basemat.Tag = UNLOADED
    Case "Super base material"
        OptSuperBaseMat
        cbo_SupBaseMat.ListIndex = -1
        cbo_SupBaseMat.Tag = UNLOADED
    Case "Module"
        OptModule
        cbo_size.ListIndex = -1
        cbo_size.Tag = UNLOADED
    Case "Thickness"
        OptHeight
        cbo_size.ListIndex = -1
        cbo_size.Tag = UNLOADED
    Case "Dimension"
        OptDimension
        cbo_size.ListIndex = -1
        cbo_size.Tag = UNLOADED
    Case "Peforation Design"
        OptPerforation
        cbo_Perforation.ListIndex = -1
        cbo_Perforation.Tag = UNLOADED
    Case "Quit": lst_toolbox.Visible = KO
    End Select
    gs_Action = ls_Action
    gs_CGCode = ls_TempCGCode
    MouseOn
    Exit Sub
    
lst_Toolbox_DblClick_Err:
    StdError
End Sub

Private Sub Opt_No_Click()

    MouseOff
    cbo_private.Visible = KO
    cbo_private.ListIndex = -1
    MouseOn

End Sub

Private Sub Opt_yes_Click()

    MouseOff
    cbo_private.Visible = OK
    MouseOn

End Sub

Private Sub Opt_yes_DblClick()
    cbo_private.Visible = 0
End Sub

Private Sub pic_Camera_Click()
Dim lb_ShortCodeGotFocus As Boolean
    If (LCase(Me.ActiveControl.Name) = "txt_short") Then
        lb_ShortCodeGotFocus = OK
    Else
        lb_ShortCodeGotFocus = KO
    End If
    MouseOff
    gs_Photo = ""
    txt_sap = ""
    gut_LangWork.Code = "E"
    Item_sel.show 1
    gut_LangWork = gut_LangLogin
    If gs_Photo <> "" Then
        ms_CopiedCode = gs_Photo
        ClearCombos
        InitCombos
        CopyCeiling
    End If
    MouseOn
    If lb_ShortCodeGotFocus Then
        txt_short.SetFocus
    End If
    
End Sub

Private Sub Pic_Dropped_Click()
    
    On Error GoTo Pic_Dropped_Err
    
    MouseOff
    gs_Date = txt_dropped
    MouseOn
    
    Dates.show 1
    
    MouseOff
    txt_dropped = gs_Date
    If txt_dropped <> "" Then
        chk_Int.Value = 0
        chk_Int.Enabled = KO
        
        chk_EstimateFlag.Value = vbUnchecked
        chk_EstimateFlag.Enabled = KO
    Else
        chk_Int.Enabled = OK
        chk_EstimateFlag.Enabled = OK
    End If
    MouseOn
    Exit Sub
    
Pic_Dropped_Err:
    StdError
End Sub

Private Sub Pic_Launch_Click()
    
    On Error GoTo Pic_Launch_Err
    
    MouseOff
    gs_Date = txt_launch
    MouseOn
    Dates.show 1
    MouseOff
    txt_launch = gs_Date
    MouseOn
    Exit Sub
    
Pic_Launch_Err:
    StdError
End Sub

Private Sub pic_quit_Click()

    MouseOff
    Unload Me
    MouseOn

End Sub

Private Sub pic_Save_Click()
Dim li_Count As Integer
Dim li_Year As Integer
Dim li_LastYear As Integer
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer

    On Error GoTo Pic_Save_Click_Err
    
    MouseOff
    Select Case gs_Action
    Case "Add"
        If Control Then
            If InsertCeiling Then
                'if this ceiling is a copy of an another, we copy also the service level associated
                If (gs_Photo <> "") Then
                    ls_req = "EXECUTE BI_Logistic_Market_cpy '" & gs_Photo & "', '" & txt_sap & "'"
                    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
                    End If
                    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
                Else
                    ls_req = "EXECUTE BI_Logistic_Market_ins2 '" & txt_sap & "'"
                    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
                    End If
                    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
                End If
                ' Inseert link into default product-market links fro SPA
                Call InsertSPALink(txt_sap.Text)
                'Update links between Plants & Suppliers depending on origin
                gs_SAPCode = txt_sap
                gb_Return = OK
                gi_BIConcurrency = 0
                DisplayPlantOrSupplier
                'Link to Year Activity
                li_Year = CInt(Mid(txt_launch.Text, 7, 4))
                If txt_dropped.Text <> "" Then
                    li_LastYear = CInt(Mid(txt_dropped.Text, 7, 4))
                Else
                    li_LastYear = Year(Now)
                End If
                For li_Count = li_Year To li_LastYear
                    InsertYear CStr(li_Count)
                Next li_Count
                BaseItemYear_mtnc.show 1
                If gs_BIType = "STD" Then
                    MouseOn
                    If SendMessage(117, "Copy the technical values from the largest group of non-dropped products ?", gut_LangLogin.Code, vbQuestion + vbYesNo, "Technical values for new item") = vbYes Then
                        MouseOff
                        GetPopulousValues
                    End If
                    MouseOff
                End If
                gs_Path = BaseItem_detail.Txt_category & "\"
                gs_Path = gs_Path & cbo_SupBaseMat.Text & "\" & cbo_Basemat.Text & "\"
                gs_Path = gs_Path & cbo_family.Text & "\"
                Select Case gs_CGCode
                Case "C001", "C006"
                    gs_Path = gs_Path & cbo_edge.Text & "\"
                Case Else
                    gs_Path = gs_Path & cbo_Group.Text & "\"
                End Select
                
                Select Case gs_CGCode
                Case "C002", "C004"
                    SendMessage 2, "Do not forget to fill in the Estimate module", gut_LangLogin.Code
                End Select
                
                gs_Path = gs_Path & txt_sap
                
                BaseItem_main.SearchLeaf (gs_SAPCode)       ' 26.05.2005 julo - tv repositioning

                ResetDisplay
            End If
        End If
    Case "Update"
        If Control Then
            If SourcingIntegrity(cbo_armstrong, cbo_origin) Then
                If UpdateCeiling Then
                     If ms_OldLaunchDate <> txt_launch.Text Or ms_OldDroppedDate <> txt_dropped.Text Then
                        DeleteAllYear
                        li_Year = CInt(Mid(txt_launch.Text, 7, 4))
                        If txt_dropped.Text <> "" Then
                            li_LastYear = CInt(Mid(txt_dropped.Text, 7, 4))
                        Else
                            li_LastYear = Year(Now)
                        End If
                        For li_Count = li_Year To li_LastYear
                            InsertYear CStr(li_Count)
                        Next li_Count
                        BaseItemYear_mtnc.show 1
                    End If
                
                    gb_Return = OK
                    gs_Path = BaseItem_detail.Txt_category & "\"
                    gs_Path = gs_Path & cbo_SupBaseMat.Text & "\" & cbo_Basemat.Text & "\"
                    gs_Path = gs_Path & cbo_family.Text & "\"
                    Select Case gs_CGCode
                    Case "C001", "C006"
                        gs_Path = gs_Path & cbo_edge.Text & "\"
                    Case Else
                        gs_Path = gs_Path & cbo_Group.Text & "\"
                    End Select
                    gs_Path = gs_Path & txt_sap
                    Unload Me
                End If
            End If
        End If
    Case "Delete"
        If DeleteItem Then
            gb_Return = OK
            gs_SAPCode = txt_sap
            gs_Path = BaseItem_detail.Txt_category & "\"
            gs_Path = gs_Path & cbo_SupBaseMat.Text & "\" & cbo_Basemat.Text & "\"
            gs_Path = gs_Path & cbo_family.Text & "\"
            Select Case gs_CGCode
            Case "C001", "C006"
                gs_Path = gs_Path & cbo_edge.Text & "\"
            Case Else
                gs_Path = gs_Path & cbo_Group.Text & "\"
            End Select
            gs_Path = gs_Path & txt_sap
            Unload Me
        End If
    End Select
    MouseOn
    Exit Sub
    
Pic_Save_Click_Err:
    StdError
End Sub

Private Sub pic_ToolBox_Click()

    On Error GoTo Pic_ToolBox_Click_Err
    
    MouseOff
    gs_Photo = ""
    If lst_toolbox.ListCount = 0 Then
        FillToolBox
    End If
    If lst_toolbox.Visible = KO Then
        lst_toolbox.Visible = OK
    Else
        lst_toolbox.Visible = KO
    End If
    MouseOn
    Exit Sub
    
Pic_ToolBox_Click_Err:
    StdError
End Sub

Private Sub pic_UnDo_Click()
    
    gs_Photo = ""
    MouseOff
    ClearCombos
    InitCombos
    GetValues
    MouseOn

End Sub

Private Function UpdateCeiling() As Boolean
Dim ls_req As String
Dim ll_Statement As Long
Dim ll_lngrows As Long
Dim li_Status As Integer
Dim ls_IntFlag As String
Dim ls_DropFlag As String
Dim ls_DropDate As String
Dim ls_LaunchDate As String
Dim ls_Private As String
Dim ls_Durable As String
Dim ls_IsASProduct As String
Dim ls_EstimateFlag As String

    UpdateCeiling = KO
    
    On Error GoTo UpdateCeiling_Err
    
    If chk_Int.Value = 1 Then
        ls_IntFlag = "X"
    End If
    ls_EstimateFlag = IIf(chk_EstimateFlag.Value = vbChecked, "X", "")
    If Opt_Yes.Value Then
        ls_Private = MCombo_GetCode(cbo_private)
    Else
        ls_Private = ""
    End If
    If optY_DurEdge.Value Then
        ls_Durable = "Yes"
    Else
        ls_Durable = "No"
    End If
    If txt_dropped <> "" Then
        ls_DropFlag = "Y"
        ls_DropDate = FormatD(txt_dropped, "mm/dd/yyyy")
    Else
        ls_DropFlag = "N"
    End If
    
    If (chk_IsASProduct.Value = vbChecked) Then
        ls_IsASProduct = "X"
    Else
        ls_IsASProduct = ""
    End If
    
    ls_LaunchDate = FormatD(txt_launch, "mm/dd/yyyy")
    Select Case gs_CGCode
    Case "C001", "C006"
        ls_req = "EXEC Base_Item_upd '" & QuoteParam(txt_sap) & "', '" _
            & QuoteParam(txt_short) & "', '" _
            & QuoteParam(txt_desc) & "', '" _
            & QuoteParam(cbo_origin) & "', '" _
            & ls_Private & "', '" _
            & MCombo_GetCode(cbo_family) & "', '" _
            & MCombo_GetCode(cbo_Basemat) & "', '" _
            & MCombo_GetCode(cbo_size) & "', '"
        ls_req = ls_req _
            & MCombo_GetCode(cbo_edge) & "', '" _
            & MCombo_GetCode(cbo_surf) & "', '" _
            & MCombo_GetCode(cbo_Colour) & "', '" _
            & MCombo_GetCode(cbo_Psegm) & "', '" _
            & MCombo_GetCode(cbo_Shape) & "', '" _
            & QuoteParam(cbo_Perf) & "', '" _
            & MCombo_GetCode(cbo_Pattern) & "', '" _
            & MCombo_GetCode(cbo_Measurement) & "', '" _
            & ls_LaunchDate & "', '"
        ls_req = ls_req _
            & QuoteParam(cbo_drawn) & "', '" _
            & QuoteParam(cbo_armstrong) & "', '" _
            & ls_DropDate & "','" & ls_DropFlag & "', " _
            & gi_BIConcurrency & ", " _
            & Formatage(txt_Length, 3) & ", " & Formatage(txt_Width, 3) & ",0," _
            & Formatage(txt_Thick, 3) & ", 0, '', " _
            & Formatage(txt_Gauge, 3) & ", '" & ls_Durable & "', '" _
            & MCombo_GetCode(cbo_SupBaseMat) & "', '" _
            & ls_IntFlag & "', '" _
            & ls_IsASProduct & "', '" _
            & MCombo_GetCode(cbo_Perforation) & "', '" _
            & MCombo_GetCode(cbo_Form) & "', '" _
            & "', '" _
            & ls_EstimateFlag & "'"
    Case Else
        ls_req = "EXEC Base_Item_upd '" & QuoteParam(txt_sap) & "', '" _
            & QuoteParam(txt_short) & "', '" _
            & QuoteParam(txt_desc) & "', '" _
            & QuoteParam(cbo_origin) & "', '" _
            & ls_Private & "', '" _
            & MCombo_GetCode(cbo_family) & "', '" _
            & MCombo_GetCode(cbo_Basemat) & "', '', '" _
            & MCombo_GetCode(cbo_Group) & "', '', '"
        ls_req = ls_req _
            & MCombo_GetCode(cbo_Colour) & "', '" _
            & MCombo_GetCode(cbo_Psegm) & "', '', '', '" _
            & MCombo_GetCode(cbo_Pattern) & "', '', '" _
            & ls_LaunchDate & "', '" _
            & QuoteParam(cbo_drawn) & "', '" _
            & QuoteParam(cbo_armstrong) & "', '" _
            & ls_DropDate & "','" & ls_DropFlag & "', " _
            & gi_BIConcurrency & ", "
        ls_req = ls_req _
            & Formatage(txt_Length, 3) & ", " & Formatage(txt_Width, 3) & ", " _
            & Formatage(txt_Height, 3) & ",0," _
            & Formatage(txt_Weight, 3) & ", '" _
            & QuoteParam(MCombo_GetCode(cbo_Corrosion)) & "', " _
            & Formatage(txt_Gauge, 3) & ", '" & ls_Durable & "', '" _
            & MCombo_GetCode(cbo_SupBaseMat) & "', '" _
            & ls_IntFlag & "', '" _
            & ls_IsASProduct & "', '" _
            & "', '" _
            & "', '" _
            & MCombo_GetCode(cbo_componentType) & "', '" _
            & ls_EstimateFlag & "'"
    End Select
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        li_Status = SQLRowCount(ll_Statement, ll_lngrows)
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        If ll_lngrows = 0 Then
            SendMessage 2, "Another user change the record", gut_LangLogin.Code
        Else
            UpdateCeiling = OK
            gi_BIConcurrency = gi_BIConcurrency + 1
        End If
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        SendMessage 4, "Update failed", gut_LangLogin.Code
    End If
    Exit Function
    
UpdateCeiling_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Function

Private Function InsertCeiling() As Boolean
Dim ls_req As String
Dim ll_Statement As Long
Dim ll_lngrows As Long
Dim li_Status As Integer
Dim ls_IntFlag As String
Dim ls_DropFlag As String
Dim ls_DropDate As String
Dim ls_LaunchDate As String
Dim ls_Private As String
Dim ls_Durable As String
Dim ls_MeasurementCode As String
Dim ls_IsASProduct As String
Dim ls_EstimateFlag As String

    InsertCeiling = KO
    
    On Error GoTo InsertCeiling_Err
    
    If chk_Int.Value = 1 Then ls_IntFlag = "X"
    ls_EstimateFlag = IIf(chk_EstimateFlag.Value = vbChecked, "X", "")
    If Opt_Yes.Value Then
        ls_Private = MCombo_GetCode(cbo_private)
    Else
        ls_Private = ""
    End If
    If optY_DurEdge.Value Then
        ls_Durable = "Yes"
    Else
        ls_Durable = "No"
    End If
    If txt_dropped <> "" Then
        ls_DropFlag = "Y"
        ls_DropDate = FormatD(txt_dropped, "mm/dd/yyyy")
    Else
        ls_DropFlag = "N"
    End If
    
    If (chk_IsASProduct.Value = vbChecked) Then
        ls_IsASProduct = "X"
    Else
        ls_IsASProduct = ""
    End If
    
    ls_LaunchDate = FormatD(txt_launch, "mm/dd/yyyy")
    Select Case gs_CGCode
    Case "C001", "C006"
        If gs_BIType = "SPC" Then
            ls_MeasurementCode = ""
        Else
            ls_MeasurementCode = MCombo_GetCode(cbo_Measurement)
        End If
        ls_req = "EXEC Base_Item_ins '" & QuoteParam(txt_sap) & "', '" _
            & gs_CGCode & "', '" _
            & QuoteParam(txt_short) & "', '" _
            & QuoteParam(txt_desc) & "', '" _
            & QuoteParam(cbo_origin) & "', '" _
            & ls_Private & "', '" _
            & MCombo_GetCode(cbo_family) & "', '" _
            & MCombo_GetCode(cbo_Basemat) & "', '" _
            & MCombo_GetCode(cbo_size) & "', '"
        ls_req = ls_req _
            & MCombo_GetCode(cbo_edge) & "', '" _
            & MCombo_GetCode(cbo_surf) & "', '" _
            & MCombo_GetCode(cbo_Colour) & "', '" _
            & MCombo_GetCode(cbo_Psegm) & "', '" _
            & MCombo_GetCode(cbo_Shape) & "', '" _
            & QuoteParam(cbo_Perf) & "', '" _
            & MCombo_GetCode(cbo_Pattern) & "', '" _
            & ls_MeasurementCode & "', '" _
            & ls_LaunchDate & "', '"
        ls_req = ls_req _
            & QuoteParam(cbo_drawn) & "', '" _
            & QuoteParam(cbo_armstrong) & "', '" _
            & ls_DropDate & "','" & ls_DropFlag & "', '" & gs_BIType & "', " _
            & Formatage(txt_Length, 3) & ", " & Formatage(txt_Width, 3) & ",0," _
            & Formatage(txt_Thick, 3) & ", 0, '', " _
            & Formatage(txt_Gauge, 3) & ", '" _
            & ls_Durable & "', '" _
            & MCombo_GetCode(cbo_SupBaseMat) & "', '" _
            & ls_IntFlag & "', '" _
            & ls_IsASProduct & "', '" _
            & MCombo_GetCode(cbo_Perforation) & "', '" _
            & MCombo_GetCode(cbo_Form) & "', '" _
            & "', '" _
            & ls_EstimateFlag & "'"
    Case Else
        ls_MeasurementCode = ""
        ls_req = "EXEC Base_Item_ins '" & QuoteParam(txt_sap) & "', '" _
            & gs_CGCode & "', '" _
            & QuoteParam(txt_short) & "', '" _
            & QuoteParam(txt_desc) & "', '" _
            & QuoteParam(cbo_origin) & "', '" _
            & ls_Private & "', '" _
            & MCombo_GetCode(cbo_family) & "', '" _
            & MCombo_GetCode(cbo_Basemat) & "', '', '"
        ls_req = ls_req _
            & MCombo_GetCode(cbo_Group) & "', '', '" _
            & MCombo_GetCode(cbo_Colour) & "', '" _
            & MCombo_GetCode(cbo_Psegm) & "', '', '', '" _
            & MCombo_GetCode(cbo_Pattern) & "', '', '" _
            & ls_LaunchDate & "', '" _
            & QuoteParam(cbo_drawn) & "', '" _
            & QuoteParam(cbo_armstrong) & "', '" _
            & ls_DropDate & "','" & ls_DropFlag & "', '" & gs_BIType & "', "
        ls_req = ls_req _
            & Formatage(txt_Length, 3) & ", " & Formatage(txt_Width, 3) & ", " _
            & Formatage(txt_Height, 3) & ",0," _
            & Formatage(txt_Weight, 3) & ", '" _
            & QuoteParam(MCombo_GetCode(cbo_Corrosion)) & "'," & Formatage(txt_Gauge, 3) & ", '" _
            & ls_Durable & "', '" _
            & MCombo_GetCode(cbo_SupBaseMat) & "', '" _
            & ls_IntFlag & "', '" _
            & ls_IsASProduct & "', '" _
            & "', '" _
            & "', '" _
            & MCombo_GetCode(cbo_componentType) & "', '" _
            & ls_EstimateFlag & "'"
    End Select
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        li_Status = SQLRowCount(ll_Statement, ll_lngrows)
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        If ll_lngrows = 0 Then
            SendMessage 4, "Insert failed", gut_LangLogin.Code
        Else
            InsertCeiling = OK
        End If
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        SendMessage 4, "Insert failed", gut_LangLogin.Code
    End If
    Exit Function
    
InsertCeiling_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Function

Private Sub InsertSPALink(ByVal as_BI_SAP_Code As String)
On Error GoTo Error_handler
    Dim ls_req As String
    Dim ll_Statement As Long
    Dim li_Status As Integer

    ls_req = "EXEC SPA_PGAMBI_Link_Default_ins '" & as_BI_SAP_Code & "'"
    
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        SendMessage 4, "Insert failed", gut_LangLogin.Code
    End If
    
    Exit Sub
Error_handler:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub

Private Sub FillToolBox()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Str1 As String

    On Error GoTo FillToolBox_Err
       
    ls_req = "EXEC Item_Toolbox_cbo "
    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_Str1 = ODBCData(ll_Statement, 1)
            Select Case gs_CGCode
            Case "C001", "C006"
                If ls_Str1 = "1" Or ls_Str1 = "3" Then
                    lst_toolbox.AddItem ODBCData(ll_Statement, 2)
                End If
            Case Else
                If ls_Str1 = "2" Or ls_Str1 = "3" Then
                    lst_toolbox.AddItem ODBCData(ll_Statement, 2)
                End If
            End Select
        End If
    Loop
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Sub
    
FillToolBox_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub

Private Sub ReadConstants()
Dim ls_Field As String
Dim ls_Text As String
Dim ls_Title As String
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer

    On Error GoTo ReadConstants_Err
    
    ls_req = "EXEC Screen_Csts 'baseitm', '" & 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 "title2": Caption = ls_Text
            Case "titleA"
                If gs_Action = "Add" Then
                    ls_Title = ls_Text
                End If
            Case "titleU"
                If gs_Action = "Update" Then
                    ls_Title = ls_Text
                End If
            Case "titleD"
                If gs_Action = "Delete" Then
                    ls_Title = ls_Text
                End If
            Case "lbl_sap": lbl_SAP = ls_Text
            Case "lbl_perf": lbl_perf = ls_Text
            Case "lbl_private": frm_Private = ls_Text
            Case "lbl_weight": lbl_Weight = ls_Text
            Case "lbl_origin": lbl_origin = ls_Text
            Case "lbl_short": lbl_short = ls_Text
            Case "lbl_descr": lbl_Desc = ls_Text
            Case "lbl_size": lbl_size = ls_Text
            Case "lbl_basemat": lbl_baseMat = ls_Text
            Case "lbl_edge": lbl_edge = ls_Text
            Case "lbl_surf": lbl_surf = ls_Text
            Case "lbl_family": lbl_family = ls_Text
            Case "lbl_colour":  lbl_colour = ls_Text
            Case "lbl_psegm": lbl_psegm = ls_Text
            Case "lbl_shape": lbl_shape = ls_Text
            Case "lbl_drawn": lbl_drawn = ls_Text
            Case "lbl_launch": lbl_launch = ls_Text
            Case "lbl_dropp": lbl_dropp = ls_Text
            Case "lbl_pattern": lbl_pattern = ls_Text
            Case "lbl_length": lbl_Length = ls_Text
            Case "lbl_width": lbl_Width = ls_Text
            Case "lbl_height": lbl_Height = ls_Text
            Case "lbl_weight": lbl_Weight = ls_Text
            Case "lbl_corr": lbl_corrosion = ls_Text
            Case "lbl_group": lbl_Group = ls_Text
            Case "lbl_category": lbl_Category = ls_Text
            Case "lbl_measurement": lbl_Measurement = ls_Text
            Case "lbl_armstrong": lbl_Armstrong = ls_Text
            Case "lbl_duredge": frm_Durable = ls_Text
            Case "lbl_gauge": lbl_Gauge = ls_Text
            Case "lbl_intflag": chk_Int.Caption = ls_Text
            Case "lbl_EstimateFlag": chk_EstimateFlag.Caption = ls_Text
            Case "lbl_IntDesc": lbl_IntDesc = ls_Text
            Case "lbl_thick": lbl_Thick = ls_Text
            Case "chk_IsASProduct": chk_IsASProduct.Caption = ls_Text
            Case "lbl_form": lbl_form.Caption = ls_Text
            Case "lbl_perforation": lbl_perforation.Caption = ls_Text
            Case "lbl_componentType": lbl_componentType.Caption = ls_Text
            End Select
        End If
    Loop
    
    SQLFreeStatement ll_Statement, SQL_DROP
    
    Caption = Caption & " : " & ls_Title
    Exit Sub
    
ReadConstants_Err:
    SQLFreeStatement ll_Statement, SQL_DROP
End Sub

Private Sub CopyCeiling()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim li_Count As Integer
Dim ls_PVcode As String
Dim lv_Code As Variant

    On Error GoTo CopyCeiling_Err
    
    ls_req = "EXEC Base_Item_t_sel '" _
        & gs_Photo & "', '" _
        & gut_LangWork.Code & "'"
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            txt_desc = ODBCData(ll_Statement, 1)
            cbo_armstrong.AddItem ODBCData(ll_Statement, 2)
            cbo_armstrong.ListIndex = 0
            cbo_origin.AddItem ODBCData(ll_Statement, 5)
            cbo_origin.ListIndex = 0
            ls_PVcode = ODBCData(ll_Statement, 6)
            If ls_PVcode <> "" Then
                Opt_Yes.Value = OK
                MCombo_AddItemCode cbo_private, ls_PVcode, ODBCData(ll_Statement, 7)
            End If
            MCombo_AddItemCode cbo_family, ODBCData(ll_Statement, 8), ODBCData(ll_Statement, 9)
            MCombo_AddItemCode cbo_SupBaseMat, ODBCData(ll_Statement, 10), ODBCData(ll_Statement, 11)
            MCombo_AddItemCode cbo_Basemat, ODBCData(ll_Statement, 12), ODBCData(ll_Statement, 13)
            MCombo_AddItemCode cbo_Pattern, ODBCData(ll_Statement, 14), ODBCData(ll_Statement, 15)
            Select Case gs_CGCode
            Case "C001", "C006"
                MCombo_AddItemCode cbo_edge, ODBCData(ll_Statement, 16), ODBCData(ll_Statement, 17)
                MCombo_AddItemCode cbo_surf, ODBCData(ll_Statement, 18), ODBCData(ll_Statement, 19)
            Case Else
                MCombo_AddItemCode cbo_Group, ODBCData(ll_Statement, 16), ODBCData(ll_Statement, 17)
            End Select
            MCombo_AddItemCode cbo_Colour, ODBCData(ll_Statement, 20), ODBCData(ll_Statement, 21)
            MCombo_AddItemCode cbo_Psegm, ODBCData(ll_Statement, 22), ODBCData(ll_Statement, 23)
            Select Case gs_CGCode
            Case "C001", "C006"
                MCombo_AddItemCode cbo_Shape, ODBCData(ll_Statement, 24), ODBCData(ll_Statement, 25)
                MCombo_AddItemCode cbo_Measurement, ODBCData(ll_Statement, 26), ODBCData(ll_Statement, 27)
                cbo_Perf.AddItem ODBCData(ll_Statement, 28)
                cbo_Perf.ListIndex = 0
            End Select
            If ODBCData(ll_Statement, 29) = "No" Then
                optN_DurEdge.Value = OK
            Else
                optY_DurEdge.Value = OK
            End If
            cbo_drawn.AddItem ODBCData(ll_Statement, 30)
            cbo_drawn.ListIndex = 0
            Select Case gs_CGCode
            Case "C001", "C006"
                MCombo_AddItemCode cbo_Form, ODBCData(ll_Statement, 48), ODBCData(ll_Statement, 49)
                MCombo_AddItemCode cbo_Perforation, ODBCData(ll_Statement, 50), ODBCData(ll_Statement, 51)
            Case Else
                MCombo_AddItemCode cbo_componentType, ODBCData(ll_Statement, 52), ODBCData(ll_Statement, 53)
            End Select
        End If
    End If
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Sub
    
CopyCeiling_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub

Private Function Control() As Boolean

    Control = KO
    
    On Error GoTo Control_Err
    
    'BI_SAP_code
    If Len(txt_sap) < 4 Then
        txt_sap.SetFocus
        SendMessage 8, "Value(s) must be filled in", gut_LangLogin.Code
        Exit Function
    End If
    'Description
    If Len(txt_desc) < 4 Then
        txt_desc.SetFocus
        SendMessage 15, "Description too short", gut_LangLogin.Code
        Exit Function
    End If
    'Armstrong product
    If cbo_armstrong.ListIndex = -1 Then
        cbo_armstrong.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    'Origin
    If cbo_origin.ListIndex = -1 Then
        cbo_origin.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    'Origin et Armstrong Product
    If Not CheckOrigin(cbo_armstrong, cbo_origin) Then
        cbo_origin.SetFocus
        SendMessage 53, "ARMSTRONG origin and ARMSTRONG product mismatch.", gut_LangLogin.Code
        Exit Function
    End If
    'Private labels
    If Opt_No.Value = 0 And cbo_private.ListIndex = -1 Then
        cbo_private.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    'Super Base Material
    If cbo_SupBaseMat.ListIndex = -1 Then
        cbo_SupBaseMat.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    'Base Material
    If cbo_Basemat.ListIndex = -1 Then
        cbo_Basemat.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    'Family
    If cbo_family.ListIndex = -1 Then
        cbo_family.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    'Pattern
    If cbo_Pattern.ListIndex = -1 Then
        cbo_Pattern.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    Select Case gs_CGCode
    Case "C001", "C006"
        'Edge
        If cbo_edge.ListIndex = -1 Then
            cbo_edge.SetFocus
            SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
            Exit Function
        End If
        'Surface
        If cbo_surf.ListIndex = -1 Then
            cbo_surf.SetFocus
            SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
            Exit Function
        End If
        'Shape
        If cbo_Shape.ListIndex = -1 Then
            cbo_Shape.SetFocus
            SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
            Exit Function
        End If
        'le module/size est controlé différemment
        If gs_BIType = "STD" Then
            If cbo_size.ListIndex = -1 Then
                cbo_size.SetFocus
                SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
                Exit Function
            End If
            'Measurement
            If cbo_Measurement.ListIndex = -1 Then
                cbo_Measurement.SetFocus
                SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
                Exit Function
            End If
        Else
            If Not SpecialSize Then Exit Function
        End If
        'Fire Performance
        If cbo_Perf.ListIndex = -1 Then
            cbo_Perf.SetFocus
            SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
            Exit Function
        End If
        'Gauge correct ?
        If Not ChkNumeric(Formatage(txt_Gauge, 3), 3) Then
            txt_Gauge.SetFocus
            Exit Function
        End If
    Case Else
        'Group
        If cbo_Group.ListIndex = -1 Then
            cbo_Group.SetFocus
            SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
            Exit Function
        End If
        'Corrosion
        If cbo_Corrosion.ListIndex = -1 Then
            cbo_Corrosion.SetFocus
            SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
            Exit Function
        End If
        If Not SpecialSize Then Exit Function
        If Not ChkNumeric(Formatage(txt_Height, 3), 3) Then
            txt_Height.SetFocus
            Exit Function
        End If
        If Not ChkNumeric(Formatage(txt_Weight, 3), 3) Then
            txt_Weight.SetFocus
            Exit Function
        End If
        'Gauge correct ?
        If Not ChkNumeric(Formatage(txt_Gauge, 3), 3) Then
            txt_Gauge.SetFocus
            Exit Function
        End If
    End Select
    'Colour
    If cbo_Colour.ListIndex = -1 Then
        cbo_Colour.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    'Product Segmentation
    If cbo_Psegm.ListIndex = -1 Then
        cbo_Psegm.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    'Launch Date
    If txt_launch = "" Then
        txt_launch.SetFocus
        SendMessage 8, "Value(s) must be filled in", gut_LangLogin.Code
        Exit Function
    End If
    'Drawn
    If cbo_drawn.ListIndex = -1 Then
        cbo_drawn.SetFocus
        SendMessage 14, " Value must exist in the list", gut_LangLogin.Code, vbExclamation
        Exit Function
    End If
    ' Launch date > Dropped date ?
    If txt_dropped > "" Then
        If IsDateGreater(txt_launch, txt_dropped) Then
            SendMessage 23, "Ending date must be greather than starting date", gut_LangLogin.Code
            txt_dropped.SetFocus
            Exit Function
        End If
    End If
    Control = OK
    Exit Function
    
Control_Err:
    StdError
End Function

Private Function DeleteItem() As Boolean
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ll_lngrows As Long

    DeleteItem = KO
    
    On Error GoTo DeleteItem_Err
    
    If SendMessage(5, "Delete record ?", gut_LangLogin.Code, vbQuestion + vbYesNo, "Delete ") = vbNo Then
        Exit Function
    End If
    ls_req = "EXEC Base_Item_del '" _
        & QuoteParam(txt_sap) & "'," _
        & gi_BIConcurrency
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        li_Status = SQLRowCount(ll_Statement, ll_lngrows)
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        If ll_lngrows = 0 Then
            SendMessage 7, "Delete failed : concurrency problem ?", gut_LangLogin.Code
        Else
            DeleteItem = OK
        End If
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    End If
    Exit Function
    
DeleteItem_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Function

Private Sub ResetDisplay()
    
    txt_sap = ""
    txt_short = ""
    txt_internetDesc = ""
    txt_desc = ""
    cbo_origin.ListIndex = -1
    cbo_armstrong.ListIndex = -1
    Opt_No.Value = OK
    cbo_private.ListIndex = -1
    cbo_family.ListIndex = -1
    cbo_SupBaseMat.ListIndex = -1
    cbo_Basemat.ListIndex = -1
    cbo_Pattern.ListIndex = -1
    cbo_edge.ListIndex = -1
    cbo_surf.ListIndex = -1
    cbo_Colour.ListIndex = -1
    cbo_Psegm.ListIndex = -1
    cbo_Shape.ListIndex = -1
    cbo_Measurement.ListIndex = -1
    cbo_size.ListIndex = -1
    cbo_Perf.ListIndex = -1
    cbo_componentType.ListIndex = -1
    cbo_Form.ListIndex = -1
    cbo_Perforation.ListIndex = -1

    txt_Gauge = ""
    optN_DurEdge.Value = OK
    txt_dropped = ""
    chk_Int.Value = 0
    chk_EstimateFlag.Value = vbUnchecked
    txt_Length = ""
    txt_Width = ""
    txt_Thick = ""
    If gs_BIType = "SPC" Then
        txt_launch = FormatD2(Date)
        chk_IsASProduct = vbChecked
    Else
        txt_launch = ""
        chk_IsASProduct = vbUnchecked
    End If
    cbo_Group.ListIndex = -1
    txt_Height = ""
    txt_Weight = ""
    cbo_Corrosion.ListIndex = -1
    gs_Photo = ""

End Sub

Private Function SpecialSize() As Boolean
    
    SpecialSize = KO
    'Numeric fields ?
    If Not ChkNumeric(Formatage(txt_Length, 3), 3) Then
        txt_Length.SetFocus
        Exit Function
    End If
    If Not ChkNumeric(Formatage(txt_Width, 3), 3) Then
        txt_Width.SetFocus
        Exit Function
    End If
    If Not ChkNumeric(Formatage(txt_Thick, 3), 3) Then
        txt_Thick.SetFocus
        Exit Function
    End If
    SpecialSize = OK
    
End Function

Private Sub ClearCombos()
    
    cbo_armstrong.Clear
    cbo_origin.Clear
    cbo_private.Clear
    cbo_SupBaseMat.Clear
    cbo_Basemat.Clear
    cbo_family.Clear
    cbo_Pattern.Clear
    cbo_edge.Clear
    cbo_Group.Clear
    cbo_surf.Clear
    cbo_Colour.Clear
    cbo_Psegm.Clear
    cbo_Shape.Clear
    cbo_Measurement.Clear
    cbo_size.Clear
    cbo_Perf.Clear
    cbo_drawn.Clear
    cbo_Corrosion.ListIndex = -1
    cbo_componentType.Clear
    cbo_Form.Clear
    cbo_Perforation.Clear

End Sub

Private Sub PlantDefault()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ll_lngrows As Long
Dim ls_MFGPCode As String

    On Error GoTo PlantDefault_Err
    
    ls_req = "EXEC Plant_Short_lst '" _
        & QuoteParam(Mid(gs_SAPCode, 1, 4)) & "', 'E'"
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            li_Status = SQLFetch(ll_Statement)
            ls_MFGPCode = ODBCData(ll_Statement, 1)
        End If
    End If
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    If ls_MFGPCode <> "" Then
        ls_req = "EXEC Base_Item_Plants_ins '" _
            & QuoteParam(gs_SAPCode) & "', '" _
            & QuoteParam(ls_MFGPCode) & "'," _
            & 0
        If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
            li_Status = SQLRowCount(ll_Statement, ll_lngrows)
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
            If ll_lngrows = 0 Then
                SendMessage 4, "Insert failed", gut_LangLogin.Code
            End If
        Else
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        End If
    End If
    Exit Sub
    
PlantDefault_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub

Private Sub DisplayPlantOrSupplier()
    'Global assignment for BaseItemSupplier_mtnc form
    Select Case cbo_origin
    Case "Manufactured"
        PlantDefault
        BaseItemPlant_mtnc.show 1
    Case "Purchased"
        BaseItemSupplier_mtnc.show 1
    End Select
End Sub

Private Sub InitCombos()
    
    cbo_armstrong.Tag = UNLOADED
    cbo_origin.Tag = UNLOADED
    cbo_private.Tag = UNLOADED
    cbo_family.Tag = UNLOADED
    cbo_SupBaseMat.Tag = UNLOADED
    cbo_Basemat.Tag = UNLOADED
    cbo_Pattern.Tag = UNLOADED
    cbo_edge.Tag = UNLOADED
    cbo_surf.Tag = UNLOADED
    cbo_Colour.Tag = UNLOADED
    cbo_Psegm.Tag = UNLOADED
    cbo_Shape.Tag = UNLOADED
    cbo_Measurement.Tag = UNLOADED
    cbo_size.Tag = UNLOADED
    cbo_Perf.Tag = UNLOADED
    cbo_drawn.Tag = UNLOADED
    cbo_Group.Tag = UNLOADED
    cbo_componentType.Tag = UNLOADED
    cbo_Form.Tag = UNLOADED
    cbo_Perforation.Tag = UNLOADED
    
    cbo_Corrosion.Clear
    MCombo_Fill cbo_Corrosion, "Exec Dictionnary_t_lst2 'Prod_corrosion','E'"
    
End Sub

Private Sub txt_desc_LostFocus()
    txt_desc = Trim(txt_desc)
End Sub

Private Sub txt_sap_LostFocus()
    txt_sap = UCase(Trim(Replace(txt_sap, vbCrLf, "")))
End Sub


Private Sub txt_short_LostFocus()
Dim ls_ReqIns As String
Dim ls_Message As String
    
    If (LCase(Me.ActiveControl.Name) = "pic_quit") Or (LCase(Me.ActiveControl.Name) = "pic_camera") Then Exit Sub
    MouseOff
    If gs_BIType = "STD" Then
        If gs_Action = "Add" Then
            If Trim(txt_short) <> "" Then
            If Not BiMktSearch Then
                ls_Message = "The short code doesn't exist. Do you want to create it ?"
                If MsgBox(ls_Message, vbQuestion + vbYesNo, "Caution ") = vbNo Then
                    txt_short.SetFocus
                    MouseOn
                    Exit Sub
                End If
                ls_ReqIns = gs_ParamReqIns
                gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_BI_Marketing' , '" & gut_LangLogin.Code & "'"
                gs_ParamReqIns = "EXEC BI_Marketing_ins '" & gs_CGCode & "', "
                gi_CodeSize = 10
                gs_TableCode = txt_short
                gs_Action = "Update"
                C_monodesc_mtnc.show 1
                gs_ParamReqIns = ls_ReqIns
                gs_Action = "Add"
                    If gb_Return Then
                        If txt_desc = "" Then
                    txt_desc = gs_TableCode
                        End If
                    txt_internetDesc = gs_TableCode
                Else
                    txt_short.SetFocus
                    MouseOn
                    Exit Sub
                End If
            End If
        End If
        End If
        If gs_Action = "Update" Then
            If Trim(txt_short) <> "" Then
            If Not BiMktSearch Then
                ls_Message = "The short code doesn't exist. Do you want to create it ?"
                If MsgBox(ls_Message, vbQuestion + vbYesNo, "Caution ") = vbNo Then
                    txt_short.SetFocus
                    MouseOn
                    Exit Sub
                End If
                ls_ReqIns = gs_ParamReqIns
                gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_BI_Marketing' , '" & gut_LangLogin.Code & "'"
                gs_ParamReqIns = "EXEC BI_Marketing_ins '" & gs_CGCode & "', "
                gi_CodeSize = 10
                gs_TableCode = txt_short
                C_monodesc_mtnc.show 1
                    If Not (gb_Return) Then
                        txt_short.SetFocus
                    End If
                    gs_Action = "Update"
                gs_ParamReqIns = ls_ReqIns
            End If
        End If
    End If
    End If
    MouseOn

End Sub

Private Function BiMktSearch() As Boolean
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Desc As String

    BiMktSearch = KO
    
    On Error GoTo BiMktSearch_Err
    
    ls_req = "EXEC BI_Marketing_Search '" & QuoteParam(txt_short) & "', '" _
            & gs_CGCode & "'"
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            ls_Desc = ODBCData(ll_Statement, 1)
            BiMktSearch = OK
            txt_internetDesc = ls_Desc
            If txt_desc = "" Then
                txt_desc = ls_Desc
            End If
        End If
    End If
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Function
    
BiMktSearch_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Function

Private Sub GetPopulousValues()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Value As String
Dim li_Count As Integer

    On Error GoTo GetPopulousValues_Err
    
    For li_Count = 1 To 36
        ls_req = "EXEC BI_Public_Value_Most_ins '" _
            & QuoteParam(txt_sap) & "', '" & QuoteParam(ms_CopiedCode) & "', " & li_Count
        If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
            li_Status = SQL_SUCCESS
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        Else
            gs_message = MsgText(109, gut_LangLogin.Code)
            If gs_message = "" Then
                gs_message = "  has not been copied."
            End If
            ls_req = "SELECT Error FROM BI_Public_Most_Error "
            If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
                li_Status = SQL_SUCCESS
                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_Value = ODBCData(ll_Statement, 1)
                        MsgBox ls_Value & ", " & gs_message
                    End If
                End If
                ls_req = "DELETE FROM BI_Public_Most_Error "
                If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
                    li_Status = SQL_SUCCESS
                End If
            Else
                li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
                SendMessage 4, "Insert failed", gut_LangLogin.Code
            End If
        End If
    Next
    Exit Sub
    
GetPopulousValues_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub


Public Property Let Item_Width(ByVal ad_val As Double)
    txt_Width.Text = ad_val
End Property

Public Property Let Item_Height(ByVal ad_val As Double)
    txt_Height.Text = ad_val
End Property

Public Property Let Item_Thickness(ByVal ad_val As Double)
    txt_Thick.Text = ad_val
End Property

Public Property Let Item_Length(ByVal ad_val As Double)
    txt_Length.Text = ad_val
End Property

