VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFlxGrd.ocx"
Begin VB.Form FrmMain 
   BackColor       =   &H00C0C0C0&
   Caption         =   "Sifyb"
   ClientHeight    =   5925
   ClientLeft      =   3840
   ClientTop       =   2190
   ClientWidth     =   8250
   ForeColor       =   &H00C0C0C0&
   Icon            =   "PROD020.frx":0000
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   5925
   ScaleWidth      =   8250
   WindowState     =   2  'Maximized
   Begin MSFlexGridLib.MSFlexGrid GRD_SubMenu 
      Height          =   1455
      Left            =   3300
      TabIndex        =   1
      Top             =   1800
      Visible         =   0   'False
      Width           =   2175
      _ExtentX        =   3836
      _ExtentY        =   2566
      _Version        =   393216
      Rows            =   1
      Cols            =   5
      FixedRows       =   0
      FixedCols       =   0
      AllowBigSelection=   0   'False
      FocusRect       =   0
      HighLight       =   0
      ScrollBars      =   0
      SelectionMode   =   1
   End
   Begin VB.Label Lbl_ForPrinter 
      AutoSize        =   -1  'True
      Caption         =   "Label1"
      Enabled         =   0   'False
      Height          =   192
      Left            =   720
      TabIndex        =   0
      Top             =   4200
      Visible         =   0   'False
      Width           =   492
   End
   Begin VB.Menu mnu_mainMenu 
      Caption         =   "Products"
      Index           =   0
      Tag             =   "P"
      Begin VB.Menu mnu_subProducts 
         Caption         =   "Standard"
         Index           =   0
         Tag             =   "PST"
      End
      Begin VB.Menu mnu_subProducts 
         Caption         =   "Special"
         Index           =   1
         Tag             =   "PSP"
      End
      Begin VB.Menu mnu_subProducts 
         Caption         =   "Semi-special"
         Index           =   2
         Tag             =   "PSE"
         Visible         =   0   'False
      End
      Begin VB.Menu mnu_subProducts 
         Caption         =   "Quick search"
         Index           =   3
         Tag             =   "MNUQSE"
      End
      Begin VB.Menu mnu_subProducts 
         Caption         =   "AS Product"
         Index           =   4
         Tag             =   "QFASP"
      End
      Begin VB.Menu mnu_subProducts 
         Caption         =   "AS-SAP compare"
         Index           =   5
         Tag             =   "METALCMP"
      End
   End
   Begin VB.Menu mnu_mainMenu 
      Caption         =   "Systems"
      Index           =   1
      Tag             =   "S"
      Begin VB.Menu mnu_subSystems 
         Caption         =   "PowerPlay Cubes Download"
         Index           =   0
         Tag             =   "MNUCD"
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "Claims"
         Index           =   1
         Tag             =   "RC"
         Begin VB.Menu mnu_subClaims 
            Caption         =   "Claim manager"
            Index           =   0
            Tag             =   "C"
         End
         Begin VB.Menu mnu_subClaims 
            Caption         =   "Reporting"
            Index           =   1
            Tag             =   "CREP"
         End
         Begin VB.Menu mnu_subClaims 
            Caption         =   "Grid description"
            Index           =   2
            Tag             =   "GD"
            Visible         =   0   'False
         End
         Begin VB.Menu mnu_subClaims 
            Caption         =   "Grid manufacturer"
            Index           =   3
            Tag             =   "GMan"
         End
         Begin VB.Menu mnu_subClaims 
            Caption         =   "Grid type"
            Index           =   4
            Tag             =   "GT"
         End
         Begin VB.Menu mnu_subClaims 
            Caption         =   "Nature"
            Index           =   5
            Tag             =   "N"
         End
         Begin VB.Menu mnu_subClaims 
            Caption         =   "Letter"
            Index           =   6
            Tag             =   "LC"
         End
         Begin VB.Menu mnu_subClaims 
            Caption         =   "Recommendation"
            Index           =   7
            Tag             =   "CR"
         End
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "DC load plan"
         Index           =   2
         Tag             =   "DCLOAD"
         Begin VB.Menu mnu_subDC 
            Caption         =   "Calendar"
            Index           =   0
            Tag             =   "MNUDCC"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Workload"
            Index           =   1
            Tag             =   "MNUDCW"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Container"
            Index           =   2
            Tag             =   "MNUDCO"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Customer shipments"
            Index           =   3
            Tag             =   "MNUDCU"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Intercompany shipments"
            Index           =   4
            Tag             =   "MNUDCI"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Receipts"
            Index           =   5
            Tag             =   "MNUDCR"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Container ending"
            Index           =   6
            Tag             =   "MNUDCE"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Customer shipments ending"
            Index           =   7
            Tag             =   "MNUDCCE"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Intercompany shipments ending"
            Index           =   8
            Tag             =   "MNUDCIE"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Receipts ending"
            Index           =   9
            Tag             =   "MNUDCRE"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Carrier table"
            Index           =   10
            Tag             =   "MNUDCCT"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "Equipement table"
            Index           =   11
            Tag             =   "MNUDCET"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "UOM table"
            Index           =   12
            Tag             =   "MNUDCUOM"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "#Invoice link"
            Index           =   13
            Tag             =   "MNUDCINV"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "DC reports"
            Index           =   14
            Tag             =   "MNUDCREP"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "#DC_PriceList"
            Index           =   15
            Tag             =   "MNUDCPL"
         End
         Begin VB.Menu mnu_subDC 
            Caption         =   "#DC_PriceList_Tender"
            Index           =   16
            Tag             =   "MNUDCPL_T"
         End
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "Quotation"
         Index           =   3
         Tag             =   "QT"
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Quotation manager"
            Index           =   0
            Tag             =   "QTM"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Comment"
            Index           =   1
            Tag             =   "QTC"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Header && footer"
            Index           =   2
            Tag             =   "QTHF"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Loose reason"
            Index           =   3
            Tag             =   "QTLR"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "System"
            Index           =   4
            Tag             =   "MNUQS"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Border"
            Index           =   5
            Tag             =   "MNUQB"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Finish"
            Index           =   6
            Tag             =   "MNUQF"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Material"
            Index           =   7
            Tag             =   "MNUQM"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Gasket"
            Index           =   8
            Tag             =   "MNUQG"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Perforation"
            Index           =   9
            Tag             =   "MNUQP"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Edge Detail"
            Index           =   10
            Tag             =   "MNUQE"
         End
         Begin VB.Menu mnu_subQuotation 
            Caption         =   "Acoustic infill"
            Index           =   11
            Tag             =   "MNUQA"
         End
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "Problems to solve"
         Index           =   4
         Tag             =   "WF"
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "Internet support"
         Index           =   5
         Tag             =   "INT"
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "IT Expenditures follow up"
         Index           =   6
         Tag             =   "MNUE"
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "Capture"
         Index           =   7
         Tag             =   "MNUCG"
         Begin VB.Menu mnu_subCapture 
            Caption         =   "Capture Online"
            Index           =   0
            Tag             =   "MNUC"
         End
         Begin VB.Menu mnu_subCapture 
            Caption         =   "Representatives reports"
            Index           =   1
            Tag             =   "RPTV"
         End
         Begin VB.Menu mnu_subCapture 
            Caption         =   "Capture Reporting"
            Index           =   2
            Tag             =   "CREP"
         End
         Begin VB.Menu mnu_subCapture 
            Caption         =   "Reporting Tools"
            Index           =   3
            Tag             =   "REPTOOL"
         End
         Begin VB.Menu mnu_subCapture 
            Caption         =   "Samples"
            Index           =   4
            Tag             =   "Mnu_Samples"
         End
         Begin VB.Menu mnu_subCapture 
            Caption         =   "SPA Admin"
            Index           =   5
            Tag             =   "SPAA"
         End
         Begin VB.Menu mnu_subCapture 
            Caption         =   "#Capture Cleaning"
            Index           =   6
            Tag             =   "CAPCLEAN"
         End
         Begin VB.Menu mnu_subCapture 
            Caption         =   "Capture Activity"
            Index           =   7
            Tag             =   "CAPACT"
         End
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "Purchasing"
         Index           =   8
         Tag             =   "MNUPURCH"
         Begin VB.Menu mnu_SubPurchasing 
            Caption         =   "Ivry Purchase Order"
            Index           =   0
            Tag             =   "IVPO"
         End
         Begin VB.Menu mnu_SubPurchasing 
            Caption         =   "SRM"
            Index           =   1
            Tag             =   "SRM"
         End
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "Human Resources"
         Index           =   9
         Tag             =   "MNUHR"
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "Competitive Database"
         Index           =   10
         Tag             =   "MNUCDB"
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "#GEMA"
         Index           =   11
         Tag             =   "GEMA"
         Begin VB.Menu mnu_SubGEMA 
            Caption         =   "#SOM"
            Index           =   0
            Tag             =   "GEMASOM"
         End
         Begin VB.Menu mnu_SubGEMA 
            Caption         =   "#Exchange Rates"
            Index           =   1
            Tag             =   "GEMARATE"
         End
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "#Time management"
         Index           =   12
         Tag             =   "TIMEMGMT"
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "#COS Electronic archiving"
         Index           =   13
         Tag             =   "EAS"
         Begin VB.Menu mnu_SubEAS 
            Caption         =   "#EAS Client"
            Index           =   0
            Tag             =   "EASCLIENT"
         End
         Begin VB.Menu mnu_SubEAS 
            Caption         =   "#EAS Viewer"
            Index           =   1
            Tag             =   "EASVIEWER"
         End
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "#Metal Sales Analysis"
         Index           =   14
         Tag             =   "MSA"
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "#Metal production"
         Index           =   15
         Tag             =   "DPC"
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#Production Capture"
            Index           =   0
            Tag             =   "CAP_OFFERPROD"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#Standard configurator"
            Index           =   1
            Tag             =   "CAP_OFFERTEMP"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#Panel reference data"
            Index           =   2
            Tag             =   "DPC_REF"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#Panel reference data 2"
            Index           =   3
            Tag             =   "DPC_REF_SYS"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#Offer reference data"
            Index           =   4
            Tag             =   "DPC_REF_2"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#BOM configuration"
            Index           =   5
            Tag             =   "DPC_REF_BOM"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#BOR configuration"
            Index           =   6
            Tag             =   "DPC_REF_BOR"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#Subconstruction reference data"
            Index           =   7
            Tag             =   "DPC_REF_SUB"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#Price data"
            Index           =   8
            Tag             =   "DPC_REF_PRICES"
         End
         Begin VB.Menu mnu_SubDPC 
            Caption         =   "#PDF Generator data"
            Index           =   9
            Tag             =   "DPC_REF_PDFGENERATOR"
         End
      End
      Begin VB.Menu mnu_subSystems 
         Caption         =   "#ONSV"
         Index           =   16
         Tag             =   "ONSV"
         Begin VB.Menu mnu_subONSV 
            Caption         =   "#ONSV reports"
            Index           =   0
            Tag             =   "ONSV_RPT"
         End
         Begin VB.Menu mnu_subONSV 
            Caption         =   "#Budgets mtnc."
            Index           =   1
            Tag             =   "ONSV_BDG"
         End
         Begin VB.Menu mnu_subONSV 
            Caption         =   "#Material group assignement"
            Index           =   2
            Tag             =   "ONSV_MG"
         End
         Begin VB.Menu mnu_subONSV 
            Caption         =   "GSV setup"
            Index           =   3
            Tag             =   "ONSV_GSV"
         End
         Begin VB.Menu mnu_subONSV 
            Caption         =   "#Markets mtnc."
            Index           =   4
            Tag             =   "ONSV_BMK"
         End
      End
   End
   Begin VB.Menu mnu_mainMenu 
      Caption         =   "Ref. Tables"
      Index           =   2
      Tag             =   "R"
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "General"
         Index           =   0
         Tag             =   "G"
         Begin VB.Menu mnu_subGeneral 
            Caption         =   "Countries"
            Index           =   0
            Tag             =   "CO"
         End
         Begin VB.Menu mnu_subGeneral 
            Caption         =   "Plants"
            Index           =   1
            Tag             =   "PL"
         End
         Begin VB.Menu mnu_subGeneral 
            Caption         =   "Distribution centres"
            Index           =   2
            Tag             =   "D"
         End
         Begin VB.Menu mnu_subGeneral 
            Caption         =   "Geographic markets"
            Index           =   3
            Tag             =   "GM"
         End
         Begin VB.Menu mnu_subGeneral 
            Caption         =   "Measurement systems"
            Index           =   4
            Tag             =   "ME"
         End
         Begin VB.Menu mnu_subGeneral 
            Caption         =   "Unit of Measures"
            Index           =   5
            Tag             =   "U"
         End
         Begin VB.Menu mnu_subGeneral 
            Caption         =   "Customers"
            Index           =   6
            Tag             =   "Cust"
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Products"
         Index           =   1
         Tag             =   "RP"
         Begin VB.Menu mnu_subRefTabProducts 
            Caption         =   "Ceilings"
            Index           =   0
            Tag             =   "CE"
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Surfaces"
               Index           =   0
               Tag             =   "PS"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Edges"
               Index           =   1
               Tag             =   "PE"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Patterns"
               Index           =   2
               Tag             =   "PP"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Colours"
               Index           =   3
               Tag             =   "PO"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Families"
               Index           =   4
               Tag             =   "PF"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Sizes"
               Index           =   5
               Tag             =   "SZ"
               Begin VB.Menu mnu_subSizes 
                  Caption         =   "Modules"
                  Index           =   0
                  Tag             =   "PM"
               End
               Begin VB.Menu mnu_subSizes 
                  Caption         =   "Heights"
                  Index           =   1
                  Tag             =   "PHE"
               End
               Begin VB.Menu mnu_subSizes 
                  Caption         =   "Dimensions"
                  Index           =   2
                  Tag             =   "PD"
               End
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Segmentation"
               Index           =   6
               Tag             =   "PG"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Shapes"
               Index           =   7
               Tag             =   "PH"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Super base materials"
               Index           =   8
               Tag             =   "PSB"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Base materials"
               Index           =   9
               Tag             =   "PB"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Private labels"
               Index           =   10
               Tag             =   "PR"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "Base item marketing"
               Index           =   11
               Tag             =   "BIM"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "#Perforation Shape"
               Index           =   12
               Tag             =   "PRFSH"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "#Perforation"
               Index           =   13
               Tag             =   "PRF"
            End
            Begin VB.Menu mnu_subCeilings 
               Caption         =   "#Form"
               Index           =   14
               Tag             =   "FORM"
            End
         End
         Begin VB.Menu mnu_subRefTabProducts 
            Caption         =   "Grids"
            Index           =   1
            Tag             =   "GR"
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Patterns"
               Index           =   0
               Tag             =   "PP"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Colours"
               Index           =   1
               Tag             =   "PO"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Families"
               Index           =   2
               Tag             =   "PF"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Groups"
               Index           =   3
               Tag             =   "GO"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Segmentation"
               Index           =   4
               Tag             =   "PG"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Super base materials"
               Index           =   5
               Tag             =   "PSB"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Base materials"
               Index           =   6
               Tag             =   "PB"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Private labels"
               Index           =   7
               Tag             =   "PR"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Base item marketing"
               Index           =   8
               Tag             =   "BIM"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "First slot"
               Index           =   9
               Tag             =   "MNUFS"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Last Slot"
               Index           =   10
               Tag             =   "MNULS"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Slot Spacing"
               Index           =   11
               Tag             =   "MNUSS"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Main Runner Coupling"
               Index           =   12
               Tag             =   "MRC"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Cross tee end details"
               Index           =   13
               Tag             =   "CTD"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "Cross tee / Main runner Interface"
               Index           =   14
               Tag             =   "CTMRI"
            End
            Begin VB.Menu mnu_subGrids 
               Caption         =   "#Component Type"
               Index           =   15
               Tag             =   "CPT"
            End
         End
         Begin VB.Menu mnu_subRefTabProducts 
            Caption         =   "Walls"
            Index           =   2
            Tag             =   "W"
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Surfaces"
               Index           =   0
               Tag             =   "PS"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Patterns"
               Index           =   1
               Tag             =   "PP"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Colours"
               Index           =   2
               Tag             =   "PO"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Families"
               Index           =   3
               Tag             =   "PF"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Groups"
               Index           =   4
               Tag             =   "GO"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Segmentation"
               Index           =   5
               Tag             =   "PG"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Super base materials"
               Index           =   6
               Tag             =   "PSB"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Base materials"
               Index           =   7
               Tag             =   "PB"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Private labels"
               Index           =   8
               Tag             =   "PR"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Sizes"
               Index           =   9
               Tag             =   "SZ"
               Begin VB.Menu mnu_subWallsSize 
                  Caption         =   "Modules"
                  Index           =   0
                  Tag             =   "PM"
               End
               Begin VB.Menu mnu_subWallsSize 
                  Caption         =   "Heights"
                  Index           =   1
                  Tag             =   "PHE"
               End
               Begin VB.Menu mnu_subWallsSize 
                  Caption         =   "Dimensions"
                  Index           =   2
                  Tag             =   "PD"
               End
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "Base item marketing"
               Index           =   10
               Tag             =   "BIM"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "#Perforation Shape"
               Index           =   11
               Tag             =   "PRFSH"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "#Perforation"
               Index           =   12
               Tag             =   "PRF"
            End
            Begin VB.Menu mnu_subWalls 
               Caption         =   "#Form"
               Index           =   13
               Tag             =   "FORM"
            End
         End
         Begin VB.Menu mnu_subRefTabProducts 
            Caption         =   "Accessories ceilings"
            Index           =   3
            Tag             =   "AC"
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Patterns"
               Index           =   0
               Tag             =   "PP"
            End
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Colours"
               Index           =   1
               Tag             =   "PO"
            End
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Families"
               Index           =   2
               Tag             =   "PF"
            End
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Groups"
               Index           =   3
               Tag             =   "GO"
            End
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Segmentation"
               Index           =   4
               Tag             =   "PG"
            End
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Super base materials"
               Index           =   5
               Tag             =   "PSB"
            End
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Base materials"
               Index           =   6
               Tag             =   "PB"
            End
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Private labels"
               Index           =   7
               Tag             =   "PR"
            End
            Begin VB.Menu mnu_subAccessCeilings 
               Caption         =   "Base item marketing"
               Index           =   8
               Tag             =   "BIM"
            End
         End
         Begin VB.Menu mnu_subRefTabProducts 
            Caption         =   "Accessories grids"
            Index           =   4
            Tag             =   "AG"
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Patterns"
               Index           =   0
               Tag             =   "PP"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Colours"
               Index           =   1
               Tag             =   "PO"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Families"
               Index           =   2
               Tag             =   "PF"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Groups"
               Index           =   3
               Tag             =   "GO"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Segmentation"
               Index           =   4
               Tag             =   "PG"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Super base materials"
               Index           =   5
               Tag             =   "PSB"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Base materials"
               Index           =   6
               Tag             =   "PB"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Private labels"
               Index           =   7
               Tag             =   "PR"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Base item marketing"
               Index           =   8
               Tag             =   "BIM"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Min. length"
               Index           =   9
               Tag             =   "MINL"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "Max. length"
               Index           =   10
               Tag             =   "MAXL"
            End
            Begin VB.Menu mnu_subAccessGrids 
               Caption         =   "#Component Type"
               Index           =   11
               Tag             =   "CPT"
            End
         End
         Begin VB.Menu mnu_subRefTabProducts 
            Caption         =   "Accessories walls"
            Index           =   5
            Tag             =   "AW"
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Patterns"
               Index           =   0
               Tag             =   "PP"
            End
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Colours"
               Index           =   1
               Tag             =   "PO"
            End
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Families"
               Index           =   2
               Tag             =   "PF"
            End
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Groups"
               Index           =   3
               Tag             =   "GO"
            End
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Segmentation"
               Index           =   4
               Tag             =   "PG"
            End
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Super base materials"
               Index           =   5
               Tag             =   "PSB"
            End
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Base materials"
               Index           =   6
               Tag             =   "PB"
            End
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Private labels"
               Index           =   7
               Tag             =   "PR"
            End
            Begin VB.Menu mnu_subAccessWalls 
               Caption         =   "Base item marketing"
               Index           =   8
               Tag             =   "BIM"
            End
         End
         Begin VB.Menu mnu_subRefTabProducts 
            Caption         =   "Miscellaneous"
            Index           =   6
            Tag             =   "MI"
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Patterns"
               Index           =   0
               Tag             =   "PP"
            End
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Colours"
               Index           =   1
               Tag             =   "PO"
            End
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Families"
               Index           =   2
               Tag             =   "PF"
            End
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Groups"
               Index           =   3
               Tag             =   "GO"
            End
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Segmentation"
               Index           =   4
               Tag             =   "PG"
            End
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Super base materials"
               Index           =   5
               Tag             =   "PSB"
            End
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Base materials"
               Index           =   6
               Tag             =   "PB"
            End
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Private labels"
               Index           =   7
               Tag             =   "PR"
            End
            Begin VB.Menu mnu_subMiscellaneous 
               Caption         =   "Base item marketing"
               Index           =   8
               Tag             =   "BIM"
            End
         End
         Begin VB.Menu mnu_subRefTabProducts 
            Caption         =   "Referenced Products"
            Index           =   7
            Tag             =   "RPP"
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Finance"
         Index           =   2
         Tag             =   "F"
         Begin VB.Menu mnu_subFinance 
            Caption         =   "Currencies"
            Index           =   0
            Tag             =   "CU"
         End
         Begin VB.Menu mnu_subFinance 
            Caption         =   "Exchange rates"
            Index           =   1
            Tag             =   "E"
            Begin VB.Menu mnu_subExchange 
               Caption         =   "Budgeted"
               Index           =   0
               Tag             =   "B"
            End
            Begin VB.Menu mnu_subExchange 
               Caption         =   "Official"
               Index           =   1
               Tag             =   "O"
            End
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Advertising"
         Index           =   3
         Tag             =   "AD"
         Begin VB.Menu mnu_subAdvertising 
            Caption         =   "Associated Files"
            Index           =   0
            Tag             =   "ASSOCF"
         End
         Begin VB.Menu mnu_subAdvertising 
            Caption         =   "Media management"
            Index           =   1
            Tag             =   "MD"
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Media manager"
               Index           =   0
               Tag             =   "MM"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Media on Dropped Products"
               Index           =   1
               Tag             =   "MDP"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Product assignement control"
               Index           =   2
               Tag             =   "MC1"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Source file reference"
               Index           =   3
               Tag             =   "MC2"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Visible on"
               Index           =   4
               Tag             =   "VO"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Type of view"
               Index           =   5
               Tag             =   "TV"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Type of memo"
               Index           =   6
               Tag             =   "TOM"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Interest"
               Index           =   7
               Tag             =   "Interest"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Source type"
               Index           =   8
               Tag             =   "SourceT"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Support type"
               Index           =   9
               Tag             =   "ST"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Owner"
               Index           =   10
               Tag             =   "OWN"
               Visible         =   0   'False
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Objectives"
               Index           =   11
               Tag             =   "AO"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Definition"
               Index           =   12
               Tag             =   "DEF"
            End
            Begin VB.Menu mnu_subMedMan 
               Caption         =   "Quality on screen"
               Index           =   13
               Tag             =   "QONS"
            End
         End
         Begin VB.Menu mnu_subAdvertising 
            Caption         =   "Recommended area"
            Index           =   2
            Tag             =   "MNURA"
            Begin VB.Menu mnu_subRecArea 
               Caption         =   "Market Segmentation"
               Index           =   0
               Tag             =   "MS"
            End
            Begin VB.Menu mnu_subRecArea 
               Caption         =   "Recommended area"
               Index           =   1
               Tag             =   "RE"
            End
            Begin VB.Menu mnu_subRecArea 
               Caption         =   "Recommended area list"
               Index           =   2
               Tag             =   "RAL"
            End
            Begin VB.Menu mnu_subRecArea 
               Caption         =   "Recommended area manager"
               Index           =   3
               Tag             =   "RAM"
            End
         End
         Begin VB.Menu mnu_subAdvertising 
            Caption         =   "Project Gallery"
            Index           =   3
            Tag             =   "MNURP"
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Marketing"
         Index           =   4
         Tag             =   "M"
         Begin VB.Menu mnu_subMarketing 
            Caption         =   "Internet News"
            Enabled         =   0   'False
            Index           =   0
            Tag             =   "MN"
         End
         Begin VB.Menu mnu_subMarketing 
            Caption         =   "Bulletin marketing"
            Enabled         =   0   'False
            Index           =   1
            Tag             =   "BUL"
         End
         Begin VB.Menu mnu_subMarketing 
            Caption         =   "Categories"
            Index           =   2
            Tag             =   "CA"
         End
         Begin VB.Menu mnu_subMarketing 
            Caption         =   "Super categories"
            Index           =   3
            Tag             =   "SC"
         End
         Begin VB.Menu mnu_subMarketing 
            Caption         =   "Suppliers"
            Index           =   4
            Tag             =   "SU"
         End
         Begin VB.Menu mnu_subMarketing 
            Caption         =   "Service level markets"
            Index           =   5
            Tag             =   "LM"
         End
         Begin VB.Menu mnu_subMarketing 
            Caption         =   "#Web Product Classification"
            Index           =   6
            Tag             =   "WPC"
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Technical"
         Index           =   5
         Tag             =   "TE"
         Begin VB.Menu mnu_subTechnical 
            Caption         =   "Tests"
            Index           =   0
            Tag             =   "TT"
            Begin VB.Menu mnu_subTest 
               Caption         =   "Test manager"
               Index           =   0
               Tag             =   "TTM"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Item Checker"
               Index           =   1
               Tag             =   "TSMICH"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Test markets"
               Index           =   2
               Tag             =   "TTK"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Test categories"
               Index           =   3
               Tag             =   "TTC"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Test types"
               Index           =   4
               Tag             =   "TTT"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Report types"
               Enabled         =   0   'False
               Index           =   5
               Tag             =   "TRT"
               Visible         =   0   'False
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Test Standards"
               Index           =   6
               Tag             =   "TTS"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Test houses"
               Index           =   7
               Tag             =   "TTH"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Test houses acreditation"
               Index           =   8
               Tag             =   "TTHA"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Conditions types"
               Index           =   9
               Tag             =   "TTCT"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Condition detail"
               Index           =   10
               Tag             =   "TTCD"
            End
            Begin VB.Menu mnu_subTest 
               Caption         =   "Result detail"
               Index           =   11
               Tag             =   "TTRD"
            End
         End
         Begin VB.Menu mnu_subTechnical 
            Caption         =   "Values"
            Index           =   1
            Tag             =   "TTV"
         End
         Begin VB.Menu mnu_subTechnical 
            Caption         =   "Technical Media Manager"
            Index           =   2
            Tag             =   "CM"
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Sales"
         Index           =   6
         Tag             =   "SA"
         Begin VB.Menu mnu_subSales 
            Caption         =   "Sales offices"
            Index           =   0
            Tag             =   "SO"
         End
         Begin VB.Menu mnu_subSales 
            Caption         =   "Sales reps"
            Index           =   1
            Tag             =   "SR"
         End
         Begin VB.Menu mnu_subSales 
            Caption         =   "Sales reps assignement"
            Index           =   2
            Tag             =   "SRA"
         End
         Begin VB.Menu mnu_subSales 
            Caption         =   "Territories"
            Index           =   3
            Tag             =   "TR"
         End
         Begin VB.Menu mnu_subSales 
            Caption         =   "Sales markets"
            Index           =   4
            Tag             =   "SM"
         End
         Begin VB.Menu mnu_subSales 
            Caption         =   "Sales project"
            Index           =   5
            Tag             =   "SPR"
         End
         Begin VB.Menu mnu_subSales 
            Caption         =   "#Reproting Area Mtnc"
            Index           =   6
            Tag             =   "SRPTA"
         End
         Begin VB.Menu mnu_subSales 
            Caption         =   "#Login_Cap_to_Rep_SAP mtnc"
            Index           =   7
            Tag             =   "SACR"
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Estimate"
         Index           =   7
         Tag             =   "MNUEST"
         Begin VB.Menu mnu_subEstimate 
            Caption         =   "Grid type"
            Index           =   0
            Tag             =   "MNUESTG"
         End
         Begin VB.Menu mnu_subEstimate 
            Caption         =   "Accessory grid type"
            Index           =   1
            Tag             =   "MNUESTAGT"
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Strategic Account Region"
         Index           =   8
         Tag             =   "SAR"
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "I.T."
         Index           =   9
         Tag             =   "I"
         Begin VB.Menu mnu_subIT 
            Caption         =   "Viewer tool"
            Index           =   0
            Tag             =   "V"
         End
         Begin VB.Menu mnu_subIT 
            Caption         =   "Media type"
            Index           =   1
            Tag             =   "MT"
         End
         Begin VB.Menu mnu_subIT 
            Caption         =   "File extension"
            Index           =   2
            Tag             =   "FE"
         End
         Begin VB.Menu mnu_subIT 
            Caption         =   "Coordinator"
            Index           =   3
            Tag             =   "CC"
         End
         Begin VB.Menu mnu_subIT 
            Caption         =   "Plant contact"
            Index           =   4
            Tag             =   "PC"
         End
      End
      Begin VB.Menu mnu_subRefTables 
         Caption         =   "Competitor analysis"
         Index           =   10
         Tag             =   "CDB2"
         Begin VB.Menu mnu_subMKT 
            Caption         =   "User Rights  Management"
            Index           =   0
            Tag             =   "MTKR"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Attachment type"
            Index           =   1
            Tag             =   "MTKA"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Business Model"
            Index           =   2
            Tag             =   "MTKB"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Channel"
            Index           =   3
            Tag             =   "MTKCH"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Competitor"
            Index           =   4
            Tag             =   "MTKC"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Communication"
            Index           =   5
            Tag             =   "MTKCM"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Compliance Rating"
            Index           =   6
            Tag             =   "MTKCP"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "General Product"
            Index           =   7
            Tag             =   "MTKP"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Material"
            Index           =   8
            Tag             =   "MTKM"
            Begin VB.Menu mnu_subMaterial 
               Caption         =   "Super category"
               Index           =   0
               Tag             =   "MTKSCG"
            End
            Begin VB.Menu mnu_subMaterial 
               Caption         =   "Super base material"
               Index           =   1
               Tag             =   "MTKSBM"
            End
            Begin VB.Menu mnu_subMaterial 
               Caption         =   "Base material"
               Index           =   2
               Tag             =   "MTKBM"
            End
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Position"
            Index           =   9
            Tag             =   "MTKPO"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Production"
            Index           =   10
            Tag             =   "MTKPD"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Sales office"
            Index           =   11
            Tag             =   "MTKSO"
         End
         Begin VB.Menu mnu_subMKT 
            Caption         =   "Technical rating"
            Index           =   12
            Tag             =   "MTKT"
         End
      End
   End
   Begin VB.Menu mnu_mainMenu 
      Caption         =   "Queries"
      Index           =   3
      Tag             =   "Q"
      Begin VB.Menu mnu_subQueries 
         Caption         =   "Product"
         Index           =   0
         Tag             =   "QP"
      End
      Begin VB.Menu mnu_subQueries 
         Caption         =   "Claim"
         Index           =   1
         Tag             =   "QC"
      End
      Begin VB.Menu mnu_subQueries 
         Caption         =   "Sales analysis"
         Index           =   2
         Tag             =   "QS"
      End
      Begin VB.Menu mnu_subQueries 
         Caption         =   "Test"
         Index           =   3
         Tag             =   "MNUQT"
      End
   End
   Begin VB.Menu mnu_mainMenu 
      Caption         =   "About"
      Index           =   4
      Tag             =   "A"
      Begin VB.Menu mnu_subAbout 
         Caption         =   "Translator"
         Index           =   0
         Tag             =   "T"
      End
      Begin VB.Menu mnu_subAbout 
         Caption         =   "Internet Translator"
         Index           =   1
         Tag             =   "TI"
      End
      Begin VB.Menu mnu_subAbout 
         Caption         =   "New Internet Translator"
         Index           =   2
         Tag             =   "NTI"
      End
      Begin VB.Menu mnu_subAbout 
         Caption         =   "Glossary Translator"
         Index           =   3
         Tag             =   "MNUGT"
      End
      Begin VB.Menu mnu_subAbout 
         Caption         =   "Password"
         Index           =   4
         Tag             =   "password"
      End
   End
End
Attribute VB_Name = "FrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'what is new
'2.6.4 : Capture cleaning component on the form (JN)
'2.6.9 : Added unload of component on unload event (JN)
'2.6.9 : Fixed error handler in Launch_CaptureArchive (JN)
'2.6.9 : Updated rights handling for module started in mnu_qfAsProduct (JN)
'2.7.1 : Support for View selection for Sales rep assignement (JN)
'2.7.1 : SAP->SR_Code maintenance screen (JN)
'2.7.1 : Area->Users maintenance screen (JN)
'2.7.5 : Cap Activity, Metal Compare for finetuning (JN)


' task 415 - external declarations - begin
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function DisableProcessWindowsGhosting Lib "user32" () As Long
Private lb_IsCommandLocked As Boolean
' task 415 - external declarations - end

' **************************************************************************************************
' **************************************** USER DEFINED ERRORS *************************************
' **************************************************************************************************
Private Enum ArmErr
    MNUNotSupported = vbObjectError + 1         ' Menu item handler is ton implemented
    QuietException = vbObjectError + 2          ' do not display error message
    SQLFailure = vbObjectError + 6               ' A SQL runtime error has occured : syntax wrong....
    SQLBadRowAffectedCount = vbObjectError + 7   ' A SQL request has not affected the expected rowcount (ex: one Update do nothing)
    SQLBadRowExpectedCount = vbObjectError + 8   ' A SQL request does not return the expected rowcount : select an item return nothing...
    CompFncFailed = vbObjectError + 10           ' when component function fail
    SQLTableReferenceConstraint = vbObjectError + 13 ' A SQL request cannot be executed : Table reference constraint
    DuplicityDetected = vbObjectError + 2301     ' detected row with same unique id
End Enum
' *************************************** USER DEFINED ERRORS **************************************
Private Const SEP As String = "®©"
Private Const SEP1 As String = "®"
Private Const SEP2 As String = "©"
Private Const C_MODULE_NAME As String = "Main form"     ' module name used in log table

Private WithEvents mo_capActivity As CapActivity
Attribute mo_capActivity.VB_VarHelpID = -1
Private WithEvents mo_metalCompare As MetalCompare
Attribute mo_metalCompare.VB_VarHelpID = -1
Public WithEvents QuotationOutLine As COutline
Attribute QuotationOutLine.VB_VarHelpID = -1
Private WithEvents TestManager As cpTstMan
Attribute TestManager.VB_VarHelpID = -1
Private WithEvents Capture As A_Capture
Attribute Capture.VB_VarHelpID = -1
Private WithEvents ref_blob As BLOBEdit
Attribute ref_blob.VB_VarHelpID = -1
Private WithEvents Samples As dsw
Attribute Samples.VB_VarHelpID = -1
Private WithEvents CapDly As CapDly
Attribute CapDly.VB_VarHelpID = -1
Private WithEvents mo_capArchive As CapArchive
Attribute mo_capArchive.VB_VarHelpID = -1
'BEGIN T299.WP4
Private WithEvents Cap_RptView As Cap_RptView
Attribute Cap_RptView.VB_VarHelpID = -1
'END T299.WP4
Private WithEvents reporting As ArmReporting
Attribute reporting.VB_VarHelpID = -1
Private WithEvents IvPO As armIVPO
Attribute IvPO.VB_VarHelpID = -1
Private WithEvents mo_SRM As SRM_Navig
Attribute mo_SRM.VB_VarHelpID = -1
Private WithEvents RefProject As SfbRefPro
Attribute RefProject.VB_VarHelpID = -1
Private WithEvents hr_ctl As HR
Attribute hr_ctl.VB_VarHelpID = -1
Private WithEvents CompetitiveDB As Comp_DB
Attribute CompetitiveDB.VB_VarHelpID = -1
Private WithEvents CDRights As MKTRightsAdmin
Attribute CDRights.VB_VarHelpID = -1
Private WithEvents mo_recommArea As RecommendedArea
Attribute mo_recommArea.VB_VarHelpID = -1
Private WithEvents mo_claimManager As SfbClaimManager
Attribute mo_claimManager.VB_VarHelpID = -1
Private WithEvents mo_medManager As MediaManager
Attribute mo_medManager.VB_VarHelpID = -1
Private WithEvents TSMItemChecker As TSMRptItm
Attribute TSMItemChecker.VB_VarHelpID = -1
Private WithEvents GEMASOM As SOM_Navig
Attribute GEMASOM.VB_VarHelpID = -1
Private WithEvents GEMARate As SOM_ExchRate
Attribute GEMARate.VB_VarHelpID = -1
Private WithEvents mo_SPA_Admin As SPA_Admin_Navig
Attribute mo_SPA_Admin.VB_VarHelpID = -1
Private WithEvents mo_EAS_Client As EAS_Client
Attribute mo_EAS_Client.VB_VarHelpID = -1
Private WithEvents mo_EAS_Viewer As EAS_Viewer
Attribute mo_EAS_Viewer.VB_VarHelpID = -1
Private WithEvents mo_RPT_Area_Mtnc As Rpt_Area_Mtnc
Attribute mo_RPT_Area_Mtnc.VB_VarHelpID = -1
Private WithEvents mo_Sales_reps_SAP_mtnc As Sales_reps_SAP_mtnc
Attribute mo_Sales_reps_SAP_mtnc.VB_VarHelpID = -1
Private WithEvents mo_TimeMgmt As TimeMgmt
Attribute mo_TimeMgmt.VB_VarHelpID = -1
Private WithEvents mo_MetalSalesAnalysis As MetalSalesAnalysis
Attribute mo_MetalSalesAnalysis.VB_VarHelpID = -1

Private WithEvents mo_Cap_OfferProd As Cap_OfferProd
Attribute mo_Cap_OfferProd.VB_VarHelpID = -1
Private WithEvents mo_Cap_OfferTemp As Cap_OfferTemp
Attribute mo_Cap_OfferTemp.VB_VarHelpID = -1
Private WithEvents mo_DPC_Ref As DPC_Ref
Attribute mo_DPC_Ref.VB_VarHelpID = -1
Private WithEvents mo_DPC_Ref_2 As DPC_Ref_2
Attribute mo_DPC_Ref_2.VB_VarHelpID = -1
Private WithEvents mo_DPC_Ref_Sys As DPC_Ref_Sys
Attribute mo_DPC_Ref_Sys.VB_VarHelpID = -1
Private WithEvents mo_DPC_Ref_Sub As DPC_Ref_Sub
Attribute mo_DPC_Ref_Sub.VB_VarHelpID = -1
Private WithEvents mo_DPC_Ref_Bor As DPC_Ref_BOR
Attribute mo_DPC_Ref_Bor.VB_VarHelpID = -1
Private WithEvents mo_DPC_Ref_Bom As DPC_Ref_BOM
Attribute mo_DPC_Ref_Bom.VB_VarHelpID = -1
Private WithEvents mo_DPC_Ref_Prices As DPC_Ref_Prices
Attribute mo_DPC_Ref_Prices.VB_VarHelpID = -1
Private WithEvents mo_DPC_Ref_PDFGenerator As DPC_Ref_PDFGenerator
Attribute mo_DPC_Ref_PDFGenerator.VB_VarHelpID = -1
Private WithEvents mo_ONSV_Rpt As ONSV_Report
Attribute mo_ONSV_Rpt.VB_VarHelpID = -1
Private WithEvents mo_ONSV_Bdg As ONSV_baselines
Attribute mo_ONSV_Bdg.VB_VarHelpID = -1
Private WithEvents mo_ONSV_GSV As ONSV_GSVManager
Attribute mo_ONSV_GSV.VB_VarHelpID = -1
Private WithEvents mo_ONSV_MG As ONSV_MGManager
Attribute mo_ONSV_MG.VB_VarHelpID = -1
Private WithEvents mo_ONSV_BMK As ONSV_BMKManager
Attribute mo_ONSV_BMK.VB_VarHelpID = -1

Private mo_Tools As DPC_Tools
Private mt_CstValues As Type_CstValues

Private WithEvents mo_DC_Invoice As DC_InvoiceMtnc
Attribute mo_DC_Invoice.VB_VarHelpID = -1
Private WithEvents mo_DC_Report As DC_Report
Attribute mo_DC_Report.VB_VarHelpID = -1
Private WithEvents mo_DC_PriceList As DC_PriceList
Attribute mo_DC_PriceList.VB_VarHelpID = -1
Private WithEvents mo_DC_PriceListTender As DC_PriceList
Attribute mo_DC_PriceListTender.VB_VarHelpID = -1

Private Type TRect
    Top As Long
    Left As Long
    Width As Long
    Height As Long
End Type

Private Zone_Client As TRect
Private mo_HandObject As Object
Private m_UCode As Long

Private Sub CDRights_quit()
  Call HideHandObject
End Sub

Private Sub CompetitiveDB_quit()
  Call HideHandObject
End Sub

Private Sub GEMARate_OnExit()
    Call HideHandObject
End Sub

Private Sub mnu_subONSV_Click(Index As Integer)
On Error GoTo ErrHandler

    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subONSV(Index).Tag
    Case "ONSV_RPT"
        Call Launch_ONSV_REPORT
    Case "ONSV_BDG"
        Call Launch_ONSV_BDG
    Case "ONSV_GSV"
        Call Launch_ONSV_GSV
    Case "ONSV_MG"
        Call Launch_ONSV_MG
    Case "ONSV_BMK"
        Call Launch_ONSV_BMK
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subONSV_Click('" & mnu_subONSV(Index).Tag & "')")

End Sub

Private Sub mo_Cap_OfferProd_IsOfferLocked(ab_IsLocked As Boolean)
  If Not Capture Is Nothing Then
    ab_IsLocked = Capture.IsComponentOpenInEdit("CapOffer")
  End If
End Sub

Private Sub mo_capActivity_quit()
    Call HideHandObject
End Sub

Private Sub mo_capArchive_quit()
    Call HideHandObject
End Sub

Private Sub mo_claimManager_AuditClick(ByVal as_CLA_code As String)
    Dim i As Integer
   
    gb_UseServerCursor = KO
    gs_GenericDetail = "DetailClaim"
    gs_Param2Req1 = "EXEC Screen_Csts aud_Claim, '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Claim_a_lst '" & as_CLA_code & "', '" & gut_LangWork.Code & "'"
    gs_Param2Req3 = "EXEC Claim_a_lst2 '" & gut_LangWork.Code & "', '"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 1200
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 1200
    gi_GridWidth2(7) = 1200
    gi_GridWidth2(8) = 1200
    gi_GridWidth2(9) = 1200
    gi_GridWidth2(10) = 1200
    gi_GridWidth2(11) = 1200
    gi_GridWidth2(12) = 1200
    gi_GridWidth2(13) = 1200
    gi_GridWidth2(14) = 1200
    gi_GridWidth2(15) = 1200
    gi_GridWidth2(16) = 1200
    gi_GridWidth2(17) = 1200
    gi_GridWidth2(18) = 1200
    gi_GridWidth2(19) = 1200
    gi_GridWidth2(20) = 1200
    For i = 21 To 29
        gi_GridWidth2(i) = 1
    Next i
    For i = 0 To 29
        gs_GridColumn2(i, 1) = i
    Next i
    gi_GridNbColumns = 23
    C_audit.show 1
    gb_UseServerCursor = KO
    gs_GenericDetail = ""


End Sub

Private Sub mo_DPC_TO_BI_quit()
    Call HideHandObject
End Sub

Private Sub mo_DC_PriceListTender_quit()
    Call HideHandObject
End Sub

Private Sub mo_metalCompare_quit()
    Call HideHandObject
End Sub

Private Sub mo_MetalSalesAnalysis_quit()
    Call HideHandObject
End Sub

Private Sub mo_ONSV_Bdg_quit()
    Call HideHandObject
End Sub

Private Sub mo_DC_Invoice_quit()
    Call HideHandObject
End Sub

Private Sub mo_DC_PriceList_quit()
    Call HideHandObject
End Sub

Private Sub mo_DC_Report_quit()
    Call HideHandObject
End Sub

Private Sub mo_ONSV_BMK_quit()
    Call HideHandObject
End Sub

Private Sub mo_ONSV_GSV_quit()
    Call HideHandObject
End Sub

Private Sub mo_ONSV_MG_quit()
    Call HideHandObject
End Sub

Private Sub mo_ONSV_Rpt_quit()
    Call HideHandObject
End Sub

Private Sub mo_RPT_Area_Mtnc_quit()
    Call HideHandObject
End Sub

Private Sub mo_Sales_reps_SAP_mtnc_quit()
    Call HideHandObject
End Sub

Private Sub mo_TimeMgmt_quit()
  Call HideHandObject
End Sub

Private Sub mo_EAS_Client_quit()
  Call HideHandObject
End Sub

Private Sub mo_EAS_Viewer_quit()
  Call HideHandObject
End Sub

Private Sub mo_medManager_quit()
  Call HideHandObject
End Sub

Private Sub mo_SPA_Admin_quit()
    Call HideHandObject
End Sub

Private Sub refProject_quit()
  Call HideHandObject
End Sub

Private Sub mo_DPC_Ref_quit()
    Call HideHandObject
End Sub

Private Sub mo_DPC_Ref_2_quit()
    Call HideHandObject
End Sub

Private Sub mo_DPC_Ref_Sys_quit()
    Call HideHandObject
End Sub

Private Sub mo_DPC_Ref_BOR_quit()
    Call HideHandObject
End Sub

Private Sub mo_DPC_Ref_BOM_quit()
    Call HideHandObject
End Sub

Private Sub mo_DPC_Ref_Sub_quit()
    Call HideHandObject
End Sub

Private Sub mo_DPC_Ref_Prices_quit()
    Call HideHandObject
End Sub

Private Sub mo_DPC_Ref_PDFGenerator_quit()
    Call HideHandObject
End Sub

Private Sub mo_Cap_OfferTemp_quit()
    Call HideHandObject
End Sub

Private Sub mo_Cap_OfferProd_quit()
    Call HideHandObject
End Sub

Private Function CheckPassword() As Integer

Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer

On Error GoTo suite

ls_req = "EXEC Security_Alias_sel"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
    gut_Param.Str1 = "0"
    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
            gut_Param.Str1 = ODBCData(ll_Statement, 1)
        End If
    Loop
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Function

suite:
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
StdError
End Function
Private Sub FillGrid(ls_Parent As String, ls_Field As String, ls_Text As String, ls_Perm As String, li_pos As Integer)

GRD_SubMenu.Row = 0
GRD_SubMenu.Col = 0
If GRD_SubMenu.Text <> "" Then
    GRD_SubMenu.Rows = GRD_SubMenu.Rows + 1
End If
GRD_SubMenu.Row = GRD_SubMenu.Rows - 1
GRD_SubMenu.Col = 0
GRD_SubMenu.Text = ls_Parent
GRD_SubMenu.Col = 1
GRD_SubMenu.Text = ls_Field
GRD_SubMenu.Col = 2
GRD_SubMenu.Text = ls_Text
GRD_SubMenu.Col = 3
GRD_SubMenu.Text = ls_Perm
GRD_SubMenu.Col = 4
GRD_SubMenu.Text = li_pos

End Sub

Private Sub DisplayProblem()

Dim li_Count As Integer

gs_WorkFlow = ""
If IsCodeExisting("Problems_ToSolve", "User_Name", prg.LoginName) Then
    gs_WorkFlow = "yes"
    gs_TableName = "Problems_ToSolve"
    gs_ParamReq1 = "EXEC Problems_ToSolve_dtl '" & prg.LoginName & "','"
    gs_ParamReq2 = "EXEC Screen_Csts 'problems', '" & gut_LangLogin.Code & "'"
    gs_ParamReq3 = "EXEC Check_Security Problems_ToSolve, " & prg.LoginName
    gi_GridWidth(0) = 1
    gi_GridWidth(1) = 1
    gi_GridWidth(2) = 1200
    gi_GridWidth(3) = 1
    gi_GridWidth(4) = 1200
    gi_GridWidth(5) = 8000
    For li_Count = 6 To 29
        gi_GridWidth(li_Count) = 1
    Next li_Count
    gi_GridNbColumns = 7
    InitMainColumns
    C_main.show 1
End If

End Sub
Private Function IsCodeExisting(ByVal ls_Table As String, ByVal ls_Code As String, ByVal ls_val As String) As Boolean

Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer

On Error GoTo suite

IsCodeExisting = KO
ls_req = "SELECT COUNT(*) FROM " & ls_Table _
    & " WHERE " & ls_Code & " = '" & ls_val & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
    Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            If ODBCData(ll_Statement, 1) > "0" Then
                IsCodeExisting = OK
            End If
        End If
    Loop
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Function

suite:
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
StdError
End Function





Private Sub Form_Resize()
    Dim frm As Form
    'FillButtons
    For Each frm In Forms
        If frm.Caption <> Me.Caption Then
            If frmMain.WindowState = 1 Then
                frm.Visible = KO
            Else
                frm.Visible = OK
            End If
        End If
    Next

    Zone_Client.Left = Me.ScaleLeft
    Zone_Client.Top = Me.ScaleTop
    Zone_Client.Width = Me.ScaleWidth
    Zone_Client.Height = Me.ScaleHeight
   
  
    If (Me.WindowState <> vbMinimized) And (Zone_Client.Height > 0) Then
        If Not mo_HandObject Is Nothing Then
            Call mo_HandObject.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        End If
    End If

End Sub

Private Sub IvPO_Quit()
    Call HideHandObject
End Sub

Private Sub mo_SRM_Quit()
    Call HideHandObject
End Sub

Private Sub mnu_ABI_Marketing()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptBI_Marketing

End Sub
Private Sub mo_claimManager_quit()
    Debug.Assert (Not mo_claimManager Is Nothing)
    Call HideHandObject
End Sub

Private Sub mo_claimManager_PrintDetail(ByVal av_detailKey As Variant)
'    Dim ls_CLA_code As String, ls_CT_code As String, ls_CLA_status As String
'    ls_CLA_code = av_detailKey(0)
'    ls_CT_code = av_detailKey(1)
'    ls_CLA_status = av_detailKey(2)
    
    Call mo_claimManager.Item_Print(av_detailKey(0))
End Sub

Private Sub mo_recommArea_quit()
    Debug.Assert (Not mo_recommArea Is Nothing)
    Call HideHandObject
End Sub

Private Sub mo_recommArea_PrintGrid(ByVal ao_grid As ArmGrid)
On Error GoTo ErrHandler
    If Printers.Count = 0 Then
        SendMessage 135, "No printer is installed on your computer. Please, contact your system administrator.", gut_LangLogin.Code
        Exit Sub
    End If
    MouseOff
    
    If ao_grid.Rows = 0 Then
        Call ao_grid.Refresh
    End If
    
    ' second array define the width of each colmuns in the print report
    Call PrintArmGrid(Array(ao_grid.Columns("CGDESC"), _
                            ao_grid.Columns("BMLDESC"), _
                            ao_grid.Columns("PFDESC"), _
                            ao_grid.Columns("PPDESC"), _
                            ao_grid.Columns("PEDESC"), _
                            ao_grid.Columns("SFDESC"), _
                            ao_grid.Columns("SHDESC"), _
                            ao_grid.Columns("RECOM")), _
                      Array(33, 33, 33, 33, 33, 33, 33, 33), mo_recommArea.Title, "", 1, 10)
    MouseOn
    Exit Sub
ErrHandler:
MouseOn
    Call MsgBox(Err.Source, , "Error message: mo_recommArea_PrintGrid")
End Sub

Private Sub mo_recommArea_ShowHelp()
    MouseOff
    gs_TableName = "Recommended_Area"
    Call frm_help.show(1)
    MouseOn
End Sub

Private Sub mnu_ASBase()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptSuperBaseMat

End Sub


Private Sub mnu_Budgeted()

Dim li_Count As Integer

gs_TableName = "Budgeted_Exchange_Rates"
gs_ParamReq1 = "EXEC Budgeted_Exchange_Rate_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_exratbu', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Budgeted_Exchange_Rates', '" & prg.LoginName & "'"
gi_GridWidth(0) = 1
gi_GridWidth(1) = 3000
gi_GridWidth(2) = 3000
gi_GridWidth(3) = 2500
For li_Count = 4 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_RPP()
Dim li_Count As Integer

gs_TableName = "RP_Product"
gs_ParamReq1 = "Exec RP_Product_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'RP_Product', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'RP_Product', " & prg.LoginName

gi_TranslateType = 9
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3000
gi_GridWidth(3) = 6000
gi_GridWidth(4) = 1000
gi_GridWidth(5) = 1000
gi_GridWidth(6) = 1000
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_CBI_Marketing()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptBI_Marketing

End Sub

Private Sub mnu_CDim()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptDimension

End Sub

Private Sub mnu_CHeight()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptHeight

End Sub

Private Sub mnu_ClaimReporting(ByVal as_caption As String)
    gut_Param.Str1 = as_caption
    gut_Param.Str2 = "CREP"
    SubMenu.show 1
End Sub

Private Sub mnu_Cross_tee_end_details()
    gs_MenuChoice = "Cross Tee End Details"
    OptCrossTeeEndDetails
End Sub

Private Sub mnu_Cross_tee_Main_runner_Interface()
    gs_MenuChoice = "Cross Tee / Main Runner Interface"
    OptCrossTeeMainRunnerInterface
End Sub

Private Sub mnu_CSBase()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptSuperBaseMat

End Sub

Private Sub mnu_DC_Calendar()

Dim li_Count As Integer

gs_TableName = "DC_Calendar"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Cal', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Max_Activity, " & prg.LoginName
gi_TranslateType = 1
DC_Choice2.show 1

End Sub

Private Sub mnu_DC_Carrier_Table()
Dim li_Count As Integer

gs_TableName = "DC_Carrier"
gs_ParamReq1 = "EXEC DC_Carrier_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_DC_Carrier, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Carrier, " & prg.LoginName
gi_TranslateType = 1

gi_GridWidth(0) = 800
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3000
gi_GridWidth(3) = 2800
gi_GridWidth(4) = 1300
gi_GridWidth(5) = 1200
gi_GridWidth(6) = 1200
gi_GridWidth(7) = 1
gi_GridWidth(8) = 1100

For li_Count = 9 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count

C_main.show 1

End Sub


Private Sub mnu_DC_Cont_End()

gs_TableName = "DC_Cont_End"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Cont', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Transaction, " & prg.LoginName
gi_TranslateType = 1

DC_Choice.show 1

End Sub

Private Sub mnu_DC_Container()

gs_TableName = "DC_Containers"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Cont', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Transaction, " & prg.LoginName
gi_TranslateType = 1

DC_Choice.show 1

End Sub


Private Sub mnu_DC_Cust_End()

gs_TableName = "DC_Cust_End"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Cust', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Transaction, " & prg.LoginName
gi_TranslateType = 1

DC_Choice.show 1

End Sub


Private Sub mnu_DC_Customer()
'mmmm
gs_TableName = "DC_Customer"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Cust', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Transaction, " & prg.LoginName
gi_TranslateType = 1

DC_Choice.show 1

End Sub


Private Sub mnu_DC_Equipement_Table()
Dim li_Count As Integer

gs_TableName = "DC_Equipement"
gs_ParamReq1 = "EXEC DC_Equipement_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_DC_Equipement', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Equipement, " & prg.LoginName
gi_TranslateType = 1

gi_GridWidth(0) = 3500
gi_GridWidth(1) = 1

For li_Count = 2 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count

C_main.show 1

End Sub


Private Sub mnu_DC_Int_End()

gs_TableName = "DC_Int_End"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Interco', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Transaction, " & prg.LoginName
gi_TranslateType = 1

DC_Choice.show 1

End Sub

Private Sub mnu_DC_Interco()

gs_TableName = "DC_Interco"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Interco', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Transaction, " & prg.LoginName
gi_TranslateType = 1

DC_Choice.show 1

End Sub


Private Sub mnu_DC_Rec_End()

gs_TableName = "DC_Rec_End"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Rec', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Transaction, " & prg.LoginName
gi_TranslateType = 1

DC_Choice.show 1

End Sub

Private Sub mnu_DC_Receipts()

gs_TableName = "DC_Receipts"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Rec', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Transaction, " & prg.LoginName
gi_TranslateType = 1

DC_Choice.show 1

End Sub

Private Sub mnu_DC_UOM_Table()
Dim li_Count As Integer

gs_TableName = "DC_UOM"
gs_ParamReq1 = "EXEC DC_UOM_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_DC_UOM, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_UOM, " & prg.LoginName
gi_TranslateType = 1

gi_GridWidth(0) = 1200
gi_GridWidth(1) = 1

For li_Count = 2 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count

C_main.show 1

End Sub


Private Sub mnu_DC_Workload()

gs_TableName = "DC_Work"
gs_ParamReq2 = "EXEC Screen_Csts 'DC_choice_Work', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security DC_Work, " & prg.LoginName
gi_TranslateType = 1
'mmmmm xxxx
DC_Choice2.show 1

End Sub


Private Sub mnu_dtl_condition()
Dim i As Integer

gs_TableName = "Test_Dtl_Condition"
gs_ParamReq1 = "EXEC Test_Dtl_Condition_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Tst_Dtlcnd', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Test_Dtl_Condition', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 1
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 2000
gi_GridWidth(5) = 1200
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1200

For i = 8 To 29
    gi_GridWidth(i) = 1
Next i
gi_ColumnIFlag = 2
C_main.show 1

End Sub

Private Sub mnu_dtl_result()
Dim i As Integer

gs_TableName = "Test_Dtl_Result"
gs_ParamReq1 = "EXEC Test_Dtl_Result_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_tst_dtlrsl', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Test_Dtl_Result', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 1
gi_GridWidth(3) = 3000
gi_GridWidth(4) = 2000
gi_GridWidth(5) = 1200
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1200

For i = 8 To 29
    gi_GridWidth(i) = 1
Next i
C_main.show 1

End Sub

Private Sub mnu_EBI_Marketing()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptBI_Marketing

End Sub

Private Sub mnu_ESBase()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptSuperBaseMat

End Sub

Private Sub mnu_EstAccGridType()

gs_CGCode = "C004"
OptGridType

End Sub

Private Sub mnu_EstGridType()

gs_CGCode = "C002"
OptGridType

End Sub

Private Sub mnu_Expend()
Dim lo_ITExpenditure As C_Generic

    Set lo_ITExpenditure = New C_Generic
    lo_ITExpenditure.ms_Screen_Name = "Main_IT_Expend"
    'gs_ParamReqCsts = "EXEC Screen_Csts 'out_IT_Expend'"
    lo_ITExpenditure.show 1
    Set lo_ITExpenditure = Nothing
End Sub

Private Sub mnu_GBI_Marketing()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptBI_Marketing

End Sub

Private Sub mnu_geo()

Dim li_Count As Integer

gs_TableName = "Geographic_Markets"
gs_ParamReq1 = "EXEC Geographic_Markets_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_geo_markets, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Geographic_Markets, " & prg.LoginName
gut_Param.Str2 = "EXEC Screen_Csts 'mtnc_geo_markets',"
gut_Param.Str3 = "EXEC Geographic_Markets_ins"
gut_Param.Str4 = "EXEC countries_geo_markets_ins"
gut_Param.Str5 = "EXEC Geographic_Markets_del"
gut_Param.Str6 = "EXEC Geographic_Markets_upd"
gut_Param.Str7 = "EXEC countries_geo_markets_ins"
gut_Param.Str8 = "EXEC countries_geo_markets_del"
gut_Param.Str9 = "EXEC countries_geo_markets_t_lst"
gut_Param.Str10 = "EXEC countries_geo_market_t_lst2"
gut_Param.Str11 = "Don't show field"
gut_Param.Str12 = "Show currency"
gut_Param.Str13 = "Don't Show code"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3000
gi_GridWidth(3) = 2500
gi_GridWidth(4) = 1200
gi_GridWidth(5) = 1200
For li_Count = 6 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_FirstSlot()
    gs_CGCode = "First"
    OptSlot
End Sub

Private Sub mnu_GlossaryTranslator()
    
    gut_Param2.Str1 = "Glossary"
    gs_TableName = ""
    Trans_LangChoice.show 1
    
End Sub

Private Sub mnu_GridDesc()

Dim li_Count As Integer

gs_TableName = "Grid_Description"
gs_ParamReq1 = "EXEC Grid_Description_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Grid_Desc', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Grid_Description', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 4000
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 2000
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_GridManuf()

Dim li_Count As Integer

gs_TableName = "Grid_Manufacturer"
gs_ParamReq1 = "EXEC Grid_Manufacturer_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Grid_Man', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Grid_Manufacturer', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 4000
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 2000
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub


Private Sub mnu_GridType()

Dim li_Count As Integer

gs_TableName = "Grid_Type"
gs_ParamReq1 = "EXEC Grid_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Grid_Type', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Grid_Type', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3000
gi_GridWidth(3) = 0
gi_GridWidth(4) = 3000
gi_GridWidth(5) = 1500
gi_GridWidth(6) = 1500
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub


Private Sub mnu_interest()

gs_TableName = "Media_Interest"
gs_ParamReq1 = "EXEC Media_Interest_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_interest, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Interest, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub

Private Sub mnu_Internet(ByVal as_caption As String)
gut_Param.Str1 = as_caption
gut_Param.Str2 = "INT"
SubMenu.show 1
End Sub

Private Sub mnu_InternetTranslator()

    gut_Param2.Str1 = "Internet"
    gs_TableName = ""
    Trans_LangChoice.show 1

End Sub

Private Sub mnu_LastSlot()
    gs_CGCode = "Last"
    OptSlot
End Sub


Private Sub mnu_Main_Runner_Coupling()
    gs_MenuChoice = "Main Runner Coupling"
    OptMainRunner
End Sub

Private Sub mnu_MaxLength()
    gs_CGCode = "Max"
    OptLength
End Sub

Private Sub mnu_MBI_Marketing()

gs_MenuChoice = "Miscellaneous"
gs_CGCode = "C007"
OptBI_Marketing

End Sub

Private Sub mnu_Media_on_Dropped_Products()
Dim li_Count As Integer

If SendMessage(142, "WARNING : This option could last several minutes. Do you wish to continue ?", gut_LangLogin.Code, vbYesNo) = vbYes Then
    gs_TableName = "MediaOnDroppedProducts"
    gs_ParamReq1 = "EXEC MediaOnDroppedProducts_t_lst '"
    gs_ParamReq2 = "EXEC Screen_Csts 'MediaDpdPdts', '" & gut_LangWork.Code & "'"
    gs_ParamReq3 = "EXEC Check_Security 'MediaOnDroppedProducts', " & prg.LoginName
    gi_GridWidth(0) = 2000
    gi_GridWidth(1) = 5000
    For li_Count = 2 To 29
        gi_GridWidth(li_Count) = 1
    Next li_Count
    C_main.show 1
End If
End Sub

Private Sub mnu_MediaControl1()
Dim li_Count As Integer

If SendMessage(142, "WARNING : This option could last several minutes. Do you wish to continue ?", gut_LangLogin.Code, vbYesNo) = vbYes Then
    gs_TableName = "MediaControl1"
    gs_ParamReq1 = "EXEC MediaControl1_t_lst '"
    gs_ParamReq2 = "EXEC Screen_Csts 'MediaControl1', '" & gut_LangWork.Code & "'"
    gs_ParamReq3 = "EXEC Check_Security 'MediaControl1', " & prg.LoginName
    gi_GridWidth(0) = 4000
    gi_GridWidth(1) = 1000
    gi_GridWidth(2) = 1000
    gi_GridWidth(3) = 1000
    For li_Count = 4 To 29
        gi_GridWidth(li_Count) = 1
    Next li_Count
    C_main.show 1
End If
End Sub

Private Sub mnu_MediaControl2()
Dim li_Count As Integer

gs_TableName = "MediaControl2"
gs_ParamReq1 = "EXEC MediaControl2_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MediaControl2', '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MediaControl2', " & prg.LoginName
gi_GridWidth(0) = 2500
gi_GridWidth(1) = 2500
gi_GridWidth(2) = 2500
gi_GridWidth(3) = 2500
For li_Count = 4 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1
End Sub

Private Sub mnu_MinLength()
    gs_CGCode = "Min"
    OptLength
End Sub


Private Sub mnu_MKT_Attachment()
Dim ll_Idx As Long

gs_TableName = "MKT_Attachment_Type"
gs_ParamReq1 = "EXEC MKT_Attachment_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_Attachment', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_Attachment_Type', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub Mnu_MKT_BM()
Dim ll_Idx As Long

gs_TableName = "MKT_Base_Material"
gut_Param.Str1 = "MKT_BM"
gs_ParamReq1 = "EXEC MKT_Base_Material_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_BM', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_Base_Material', " & prg.LoginName
gi_TranslateType = 1

gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 2500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 2500
gi_GridWidth(5) = 3500
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1
gi_GridWidth(8) = 1
gi_GridWidth(9) = 1

For ll_Idx = 10 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_BusMod()
Dim ll_Idx As Long

gs_TableName = "MKT_BusMod_Type"
gs_ParamReq1 = "EXEC MKT_BusMod_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_BusMod', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_BusMod_Type', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_Channel()
Dim ll_Idx As Long

gs_TableName = "MKT_CHNL_Type"
gs_ParamReq1 = "EXEC MKT_CHNL_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_CHNL', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_CHNL_Type', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_Communication()
Dim ll_Idx As Long

gs_TableName = "MKT_Com_Type"
gs_ParamReq1 = "EXEC MKT_Com_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_Comm', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_Com_Type', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_Competitor()
Dim ll_Idx As Long

gs_TableName = "MKT_Competitor"
gs_ParamReq1 = "EXEC MKT_Competitor_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_Comp', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_Competitor', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_Compliance()
Dim ll_Idx As Long

gs_TableName = "MKT_ComplianceRNKG"
gs_ParamReq1 = "EXEC MKT_ComplianceRNKG_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_Compliance', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_ComplianceRNKG', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_Position()
Dim ll_Idx As Long

gs_TableName = "MKT_Position"
gs_ParamReq1 = "EXEC MKT_Position_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_Position', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_Position', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_Product()
Dim ll_Idx As Long

gs_TableName = "MKT_GP_Type"
gs_ParamReq1 = "EXEC MKT_GP_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_GP', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_GP_Type', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_Production()
Dim ll_Idx As Long

gs_TableName = "MKT_Prod_Type"
gs_ParamReq1 = "EXEC MKT_Prod_type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_Production', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_Prod_type', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub Mnu_MKT_SBM()
Dim ll_Idx As Long

gs_TableName = "MKT_Super_Base_Material"
gut_Param.Str1 = "MKT_SBM"
gs_ParamReq1 = "EXEC MKT_Super_Base_Material_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_SBM', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_Super_Base_Material', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 1
gi_GridWidth(3) = 4000
gi_GridWidth(4) = 4000
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1
gi_GridWidth(8) = 1

For ll_Idx = 9 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub Mnu_MKT_SCG()
Dim ll_Idx As Long

gs_TableName = "MKT_Super_Categories"
gs_ParamReq1 = "EXEC MKT_Super_Categories_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_SCG', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_Super_Categories', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_SO()
Dim ll_Idx As Long

gs_TableName = "MKT_SalesOffice_Type"
gs_ParamReq1 = "EXEC MKT_SalesOffice_type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_SO', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_SalesOffice_Type', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_MKT_Technical()
Dim ll_Idx As Long

gs_TableName = "MKT_TSRating"
gs_ParamReq1 = "EXEC MKT_TSRating_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'MKT_Technical', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'MKT_TSRating', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1

For ll_Idx = 8 To 29
    gi_GridWidth(ll_Idx) = 1
Next

C_main.show 1

End Sub

Private Sub mnu_NewInternetTranslator()

    gut_Param2.Str1 = "NewInternet"
    gs_TableName = ""
    Trans_LangChoice.show 1

End Sub

Private Sub mnu_news()

'gs_TableName = "news"
'gs_TableTitle = mnu_News.Caption
'LoadForm frm_im_main

End Sub

Private Sub mnu_Password()
gut_Param.Str2 = "FREE"
Change_Password.show 1
End Sub

Private Sub mnu_QueryClaim(ByVal as_caption As String)

ClearParam
' Target table for entity code
gut_Param.Str1 = "Claim"
' Target column for entity code
gut_Param.Str4 = "CLA_code"
' Language to use for entity code
gut_Param.Str5 = "E"
' Target table for entity description
gut_Param.Str6 = "Claim"
' Target column for entity description
gut_Param.Str7 = "CLA_description"
' Beginning of the SP name for detail
gut_Param.Str8 = "Claim_"
' Name of local file
'gut_Param.Str9 = "Claim"
' Title for query manager
gut_Param.Str10 = as_caption        ' mnu_QueryClaim.Caption
Query.show 1

End Sub

Private Sub mnu_QueryProduct(ByVal as_caption As String)

ClearParam
' Target table for entity code
gut_Param.Str1 = "Base_Item"
' Target column for entity code
gut_Param.Str4 = "BI_SAP_code"
' Language to use for entity code
gut_Param.Str5 = "E"
' Target table for entity description
gut_Param.Str6 = "Base_Item_Desc"
' Target column for entity description
gut_Param.Str7 = "BI_desc"
' Beginning of the SP name for detail
gut_Param.Str8 = "Base_Item_"
' Name of local file
'gut_Param.Str9 = "Ceil"
' Title for query manager
gut_Param.Str10 = as_caption        ' mnu_QueryProduct.Caption
Query.show 1

End Sub
Private Sub mnu_QuerySales(ByVal as_caption As String)
ClearParam
' Target table for entity code
gut_Param.Str1 = "sa_historic"
' Target column for entity code
gut_Param.Str4 = "sa_billing_document_number"
' Language to use for entity code
gut_Param.Str5 = ""
' Target table for entity description
gut_Param.Str6 = ""
' Target column for entity description
gut_Param.Str7 = ""
' Beginning of the SP name for detail
gut_Param.Str8 = "Sales_"
' Name of local file
'gut_Param.Str9 = "SAH"
' Title for query manager
gut_Param.Str10 = as_caption        ' mnu_QuerySales.Caption
Query.show 1
End Sub


Private Sub mnu_QueryTest(ByVal as_caption As String)

ClearParam
' Target table for entity code
gut_Param.Str1 = "Test"
' Target column for entity code
gut_Param.Str4 = "Full_Test_Number"
' Language to use for entity code
gut_Param.Str5 = "E"
' Target table for entity description
gut_Param.Str6 = "Test"
' Target column for entity description
gut_Param.Str7 = "Indicative_test_number"
' Beginning of the SP name for detail
gut_Param.Str8 = "QTest_"
' Name of local file
'gut_Param.Str9 = "Ceil"
' Title for query manager
gut_Param.Str10 = as_caption        ' mnu_QueryTest.Caption
Query.show 1
End Sub

Private Sub mnu_quick_search()

gs_CGCode = ""
gs_Photo = ""
Load Item_sel
Item_sel.ms_TypeCodeReturn = 2
Item_sel.show 1

End Sub


Private Sub mnu_QuotAcoustic()
Dim li_Count As Integer

gs_TableName = "Quot_MetalAcoustic"
gs_ParamReq1 = "EXEC Quot_MetalAcoustic_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_QMA', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Quot_MetalAcoustic', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QuotationManager()
gs_TableName = "Quotation"
Actor
Set QuotationOutLine = New COutline
If gut_Actor.MSC = OK Then
    QuotationOutLine.b_AddbuttonVisible = OK
End If
QuotationOutLine.i_DefaultView = 1
Quotation_DefaultView
QuotationOutLine.i_NbScreenView = 4
QuotationOutLine.s_SystemName = gs_TableName
QuotationOutLine.i_FormWidth = 11955
QuotationOutLine.i_FormHeight = 8550
QuotationOutLine.l_LeftToolsBar = 7450
QuotationOutLine.l_TopToolsBar = 720
QuotationOutLine.show
QuotationOutLine.SetParent frmMain.hwnd
AllMenuDisabled
End Sub

Private Sub mnu_QuotBorder()
Dim li_Count As Integer

gs_TableName = "Quot_MetalBorder"
gs_ParamReq1 = "EXEC Quot_MetalBorder_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_QMB', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Quot_MetalBorder', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QuotC()
Dim li_Count As Integer

gs_TableName = "Quot_Comment"
gs_ParamReq1 = "EXEC Quot_Comment_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'Quot_Comment', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Quot_Comment, " & prg.LoginName
gi_TranslateType = 4
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 2500
gi_GridWidth(3) = 1200
gi_GridWidth(4) = 1200
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QuotEdge()
Dim li_Count As Integer

gs_TableName = "Quot_MetalEdge"
gs_ParamReq1 = "EXEC Quot_MetalEdge_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_QME', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Quot_MetalEdge', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QuotFinish()
Dim li_Count As Integer

gs_TableName = "Quot_MetalFinish"
gs_ParamReq1 = "EXEC Quot_MetalFinish_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_QMF', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Quot_MetalFinish', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QuotGasket()
Dim li_Count As Integer

gs_TableName = "Quot_MetalGasket"
gs_ParamReq1 = "EXEC Quot_MetalGasket_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_QMG', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Quot_MetalGasket', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Public Sub mnu_QuotHF()
Dim li_Count As Integer
    gs_TableName = "TopBottomPage"
    gs_ParamReq1 = "EXEC TopBottomPage_t_lst 2,'"
    gs_ParamReq2 = "EXEC Screen_Csts 'Main_TopBottom', '" & gut_LangLogin.Code & "'"
    gs_ParamReq3 = "EXEC Check_Security 'TopBottomPage', " & prg.LoginName
    gi_TranslateType = 4
    gi_GridWidth(0) = 1     ' SP_Code
    gi_GridWidth(1) = 1     ' iConcurrency
    gi_GridWidth(2) = 6000  ' Description
    gi_GridWidth(3) = 1     ' Position code
    gi_GridWidth(4) = 1000  ' Position desc
    gi_GridWidth(5) = 1     ' Company code
    gi_GridWidth(6) = 2500  ' Company desc
    gi_GridWidth(7) = 1     ' System code
    gi_GridWidth(8) = 1000   ' internet flag
    gi_GridWidth(9) = 1     ' drop flag
    gi_GridWidth(10) = 1000  ' drop date
    gut_Param.Str14 = QUOTATION_SYSTEM_CODE      ' System
    For li_Count = 11 To 29
        gi_GridWidth(li_Count) = 1
    Next li_Count
    C_main.show 1
End Sub

Private Sub mnu_QuotLR()
Dim li_Count As Integer

gs_TableName = "Quot_LoseReason"
gs_ParamReq1 = "EXEC Quot_LoseReason_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'Losereason', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Quot_LoseReason, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 2500
gi_GridWidth(3) = 1200
gi_GridWidth(4) = 1200
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QuotMaterial()
Dim li_Count As Integer

gs_TableName = "Quot_MetalMaterial"
gs_ParamReq1 = "EXEC Quot_MetalMaterial_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_QMM', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Quot_MetalMaterial', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QuotPerforation()
Dim li_Count As Integer

gs_TableName = "Quot_MetalPerforation"
gs_ParamReq1 = "EXEC Quot_MetalPerforation_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_QMPE', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Quot_MetalPerforation', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QuotSystem()
Dim li_Count As Integer

gs_TableName = "Quot_MetalSystem"
gs_ParamReq1 = "EXEC Quot_MetalSystem_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_QMSY', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Quot_MetalSystem', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 1
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1
    
End Sub

Private Sub mnu_RBI_Marketing()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptBI_Marketing

End Sub

Public Sub mnu_SalesProject()
Dim li_Count As Integer
    gs_TableName = "SalesProject"
    gs_ParamReq1 = "EXEC Sales_Project_t_lst '"
    gs_ParamReq2 = "EXEC Screen_Csts 'Main_Sales_Proj', '" & gut_LangLogin.Code & "'"
    gs_ParamReq3 = "EXEC Check_Security 'Sales_Project', " & prg.LoginName
    gi_TranslateType = 4
    gi_GridWidth(0) = 1     ' SP_Code
    gi_GridWidth(1) = 1     ' iConcurrency
    gi_GridWidth(2) = 2500  ' Description
    gi_GridWidth(3) = 1000  ' Start date
    gi_GridWidth(4) = 1000  ' Size
    gi_GridWidth(5) = 1000  ' Unit of measure code
    gi_GridWidth(6) = 1     ' Unit of measure desc
    gi_GridWidth(7) = 1     ' Zip
    gi_GridWidth(8) = 2000  ' Town
    gi_GridWidth(9) = 1     ' Country code
    gi_GridWidth(10) = 2000 ' Country desc
    gi_GridWidth(11) = 3500 ' Addr1
    gi_GridWidth(12) = 3500 ' Addr2
    gi_GridWidth(13) = 1    ' Comment
    gi_GridWidth(14) = 1    ' internet flag
    gi_GridWidth(15) = 1    ' drop flag
    For li_Count = 16 To 29
        gi_GridWidth(li_Count) = 1
    Next li_Count
    C_main.show 1
End Sub

Private Sub mnu_SlotSpacing()
    gs_CGCode = "Spacing"
    OptSlot
End Sub


Private Sub Form_Load()


' not sure if it the best place     JN. 2.May.2016
DisableProcessWindowsGhosting

Dim li_Width As Integer
Dim li_Height As Integer
Dim li_top As Integer

On Error GoTo suite

MouseOff

lb_IsCommandLocked = False

If gl_CodePage <> 1252 And gl_CodePage <> 0 Then ChangeCharset Me

'Not checked anymore : replaced by US strong password policy
'CheckPassword
'If gut_Param.Str1 > 89 Then
'    Password_Information.show 1
'End If

If GetExistingInfo <> 0 Then
    Information.show 1
End If
gut_LangWork = gut_LangLogin
GetCaptions
' temporary enabled
GetMenuCtrl(mnu_subMarketing, "BUL").Enabled = False     'mnu_bulletin.Enabled = False
GetMenuCtrl(mnu_subMarketing, "MN").Enabled = False      ' mnu_news.Enabled = False

'FillButtons

    Zone_Client.Left = 0
    Zone_Client.Top = 0
    Zone_Client.Width = Width
    Zone_Client.Height = Me.Height - 10


BLUE = RGB(0, 0, 255)
BLACK = RGB(0, 0, 0)
DisplayProblem
Unload frm_Login


    Me.Caption = Me.Caption & " " & prg.Environment & " - " & prg.CurrentServerIP & prg.ServerInstance & " – Version : " & App.Major & "." & App.Minor & "." & App.Revision & " [" & prg.LoginName & " - " & prg.Session_language & "]" & IIf(prg.WTS, " (User cache:" & prg.AppCache_Dir & ")", "")



    Dim lCurs As Long
    lCurs = aDb.OpenSQL("GetU_Code '" & prg.LoginName & "'")
    m_UCode = aDb.GetFields(lCurs, "U_Code")
    aDb.Close (lCurs)
    
    Set mo_Tools = New DPC_Tools
    Set mo_Tools.ArmDb = aDb
    Call mo_Tools.Load_A_COM
    
    Set mt_CstValues = New Type_CstValues
MouseOn
Exit Sub

suite:
StdError
End Sub
Private Sub Form_Unload(Cancel As Integer)

MouseOff
WriteUserEvent "Logout"
Me.Visible = False

    If Not Capture Is Nothing Then
        Call Capture.Unload_A_COM
    End If
    If Not Samples Is Nothing Then
        Call Samples.Unload_A_COM
        Set Samples = Nothing
    End If
    If Not CapDly Is Nothing Then
        Call CapDly.Unload_A_COM
    End If
    If Not mo_capArchive Is Nothing Then
        Call mo_capArchive.Unload_A_COM
    End If
    
    If Not ref_blob Is Nothing Then
        Call ref_blob.Unload_A_COM
    End If
    If Not IvPO Is Nothing Then
        Call IvPO.Unload_A_COM
    End If
    If Not mo_SRM Is Nothing Then
        Call mo_SRM.Unload_A_COM
    End If
    If Not RefProject Is Nothing Then
        Call RefProject.Unload_A_COM
    End If
    If Not hr_ctl Is Nothing Then
        Call hr_ctl.Unload_A_COM
    End If
    If Not CompetitiveDB Is Nothing Then
        Call CompetitiveDB.Unload_A_COM
    End If
    If Not CDRights Is Nothing Then
        Call CDRights.Unload_A_COM
    End If
    If Not mo_medManager Is Nothing Then
        Call mo_medManager.Unload_A_COM
    End If
    If Not TSMItemChecker Is Nothing Then
        Call TSMItemChecker.Unload_A_COM
    End If
    If Not GEMASOM Is Nothing Then
        Call GEMASOM.Unload_A_COM
    End If
    If Not GEMARate Is Nothing Then
        Call GEMARate.Unload_A_COM
    End If
    If Not mo_SPA_Admin Is Nothing Then
        Call mo_SPA_Admin.Unload_A_COM
    End If
    If Not mo_EAS_Client Is Nothing Then
        Call mo_EAS_Client.Unload_A_COM
    End If
    If Not mo_EAS_Viewer Is Nothing Then
        Call mo_EAS_Viewer.Unload_A_COM
    End If
    If Not mo_TimeMgmt Is Nothing Then
        Call mo_TimeMgmt.Unload_A_COM
    End If
    If Not mo_MetalSalesAnalysis Is Nothing Then
        Call mo_MetalSalesAnalysis.Unload_A_COM
    End If
    
'BEGIN T299.WP4
    If Not Cap_RptView Is Nothing Then
        Call Cap_RptView.Unload_A_COM
    End If
'END T299.WP4
    
    If Not TestManager Is Nothing Then
        Call TestManager.Unload_A_COM
    End If

    If Not reporting Is Nothing Then
        Call reporting.Unload_A_COM
    End If

    If Not mo_recommArea Is Nothing Then
        Call mo_recommArea.Unload_A_COM
    End If

    If Not mo_claimManager Is Nothing Then
        Call mo_claimManager.Unload_A_COM
    End If

    If Not mo_Tools Is Nothing Then
        Call mo_Tools.Unload_A_COM
    End If
    
    If Not mo_DC_Invoice Is Nothing Then
        Call mo_DC_Invoice.Unload_A_COM
        End If


    If Not mo_ONSV_Rpt Is Nothing Then
        Call mo_ONSV_Rpt.Unload_A_COM
    End If
  
    If Not mo_ONSV_Bdg Is Nothing Then
        Call mo_ONSV_Bdg.Unload_A_COM
    End If

    If Not mo_DC_Report Is Nothing Then
        Call mo_DC_Report.Unload_A_COM
        End If
  
    If Not mo_ONSV_BMK Is Nothing Then
        Call mo_ONSV_BMK.Unload_A_COM
    End If
  
    If Not mo_DC_PriceList Is Nothing Then
        Call mo_DC_PriceList.Unload_A_COM
    End If

    If Not mo_ONSV_GSV Is Nothing Then
        Call mo_ONSV_GSV.Unload_A_COM
    End If
  
    If Not mo_ONSV_MG Is Nothing Then
        Call mo_ONSV_MG.Unload_A_COM
    End If

    Set mt_CstValues = Nothing
session_end
Unload frmMain
MouseOn
End

End Sub

Private Sub mnu_ABase()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptBaseMaterial

End Sub
Private Sub mnu_AboutTranslator()

    gut_Param2.Str1 = ""
    gs_TableName = ""
    Trans_LangChoice.show 1

End Sub
Private Sub mnu_AColour()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptColour

End Sub
Private Sub mnu_AFamily()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptFamily

End Sub
Private Sub mnu_AGroup()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptGroup

End Sub
Private Sub mnu_ALabel()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptLabel

End Sub
Private Sub mnu_APattern()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptPattern

End Sub
Private Sub mnu_Area()

Dim li_Count As Integer

gs_TableName = "Recommended_Area"
gs_ParamReq1 = "EXEC Recommended_Area_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_rec_area', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Recommended_Area', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 4000
For li_Count = 3 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
gi_ColumnIFlag = 0
C_main.show 1

End Sub
Private Sub mnu_ASegment()

gs_MenuChoice = "Accessories walls"
gs_CGCode = "C005"
OptSegment

End Sub
Private Sub mnu_Assignement(ByVal as_caption As String)

gut_Param.Str1 = as_caption         ' mnu_Value.Caption
gut_Param.Str2 = "SRA"
SubMenu.show 1

End Sub
Private Sub mnu_bulletin()

'gs_TableName = "bulletin_marketing"
'gs_TableTitle = mnu_bulletin.Caption
'frm_im_main.show 1

End Sub
Private Sub mnu_Category()

Dim li_Count As Integer

gs_TableName = "Categories"
gs_ParamReq1 = "EXEC Categories_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Categories', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Categories', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 2500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 2500
gi_GridWidth(5) = 1
gi_GridWidth(6) = 2000
gi_GridWidth(7) = 1000
gi_GridWidth(8) = 1000
For li_Count = 9 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_CBase()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptBaseMaterial

End Sub
Private Sub mnu_CColour()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptColour

End Sub
Private Sub mnu_CEdge()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptEdge

End Sub
Private Sub mnu_CFamily()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptFamily

End Sub
Private Sub mnu_CLabel()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptLabel

End Sub
Private Sub mnu_CModule()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptModule

End Sub
Private Sub mnu_Coordinator()

Debug.Assert (False)

Dim li_Count As Integer

gs_TableName = "Claim_Coordinator"
gs_ParamReq1 = "EXEC Claim_Coordinator_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_ClaimCoord', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Claim_Coordinator', '" & prg.LoginName & "'"
gi_TranslateType = 7
gi_GridWidth(0) = 1
gi_GridWidth(1) = 3000
gi_GridWidth(2) = 2000
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 1500
gi_GridWidth(5) = 1500
For li_Count = 6 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Country()

Dim li_Count As Integer

gs_TableName = "Countries"
gs_ParamReq1 = "EXEC Countries_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Country', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Countries', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 2500
gi_GridWidth(3) = 1
gi_GridWidth(4) = 2000
gi_GridWidth(5) = 1200
gi_GridWidth(6) = 1200
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_CPattern()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptPattern

End Sub
Private Sub mnu_CSegment()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptSegment

End Sub
Private Sub mnu_CShape()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptShape

End Sub
Private Sub mnu_CSurface()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptSurface

End Sub

Private Sub mnu_RComponentType()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptComponentType

End Sub

Private Sub mnu_GComponentType()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptComponentType

End Sub


Private Sub mnu_CPerforation()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptPerforation

End Sub

Private Sub mnu_CPerforationShape()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptPerforationShape

End Sub

Private Sub mnu_CForm()

gs_MenuChoice = "Ceilings"
gs_CGCode = "C001"
OptForm

End Sub

Private Sub mnu_WPerforation()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptPerforation

End Sub

Private Sub mnu_WPerforationShape()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptPerforationShape

End Sub

Private Sub mnu_WForm()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptForm

End Sub


Private Sub mnu_Currency()

Dim li_Count As Integer

gs_TableName = "Currencies"
gs_ParamReq1 = "EXEC Currencies_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_currenc', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Currencies', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1500
gi_GridWidth(1) = 7000
For li_Count = 2 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Customer()

Dim li_Count As Integer

gs_TableName = "Customer"
gs_ParamReq1 = "EXEC Customer_t_lst '" & prg.LoginName & "', '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Customer', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Customer', '" & prg.LoginName & "'"
gi_TranslateType = 1
For li_Count = 0 To 5
    gi_GridWidth(li_Count) = 1400
Next li_Count
For li_Count = 6 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Def()

Dim li_Count As Integer

gs_TableName = "Definition"
gs_ParamReq1 = "EXEC Media_Definition_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Definition, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Definition, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 5000
For li_Count = 2 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_Distrib()

Dim li_Count As Integer

gs_TableName = "Dist_Centre"
gs_ParamReq1 = "EXEC Dist_Centre_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_dist_ctr, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Dist_Centre, " & prg.LoginName
gi_TranslateType = 4
gi_GridWidth(0) = 1000
gi_GridWidth(1) = 2000
gi_GridWidth(2) = 1000
gi_GridWidth(3) = 1000
gi_GridWidth(4) = 1500
gi_GridWidth(5) = 1000
gi_GridWidth(6) = 1000
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_EBase()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptBaseMaterial

End Sub
Private Sub mnu_EColour()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptColour

End Sub
Private Sub mnu_EFamily()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptFamily

End Sub
Private Sub mnu_EGroup()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptGroup

End Sub
Private Sub mnu_ELabel()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptLabel

End Sub
Private Sub mnu_EPattern()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptPattern

End Sub
Private Sub mnu_ESegment()

gs_MenuChoice = "Accessories ceilings"
gs_CGCode = "C003"
OptSegment

End Sub
Private Sub mnu_Fe()

Dim li_Count As Integer

gs_TableName = "File_Extension"
gs_ParamReq1 = "EXEC Media_File_Ext_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_File_Ext, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_File_Ext, " & prg.LoginName
gi_GridWidth(0) = 1
gi_GridWidth(1) = 4000
gi_GridWidth(2) = 1500
gi_GridWidth(3) = 1500
gi_GridWidth(4) = 1500
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_GBase()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptBaseMaterial

End Sub
Private Sub mnu_GColour()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptColour

End Sub
Private Sub mnu_GFamily()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptFamily

End Sub
Private Sub mnu_GGroup()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptGroup

End Sub
Private Sub mnu_GLabel()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptLabel

End Sub
Private Sub mnu_GPattern()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptPattern

End Sub

Private Sub mnu_GSBase()

gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptSuperBaseMat

End Sub
Private Sub mnu_GSegment()

MouseOff
Call HideHandObject
gs_MenuChoice = "Grids"
gs_CGCode = "C002"
OptSegment
MouseOn

End Sub


Private Sub mnu_Letter()

Dim li_Count As Integer

gs_TableName = "Claim_Letter"
gs_ParamReq1 = "EXEC Claim_Letter_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_letclai', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Claim_Letter', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 1
gi_GridWidth(3) = 2500
gi_GridWidth(4) = 2500
gi_GridWidth(5) = 1500
gi_GridWidth(6) = 1500
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_Log()

Dim li_Count As Integer

gs_TableName = "Logistic_Markets"
gs_ParamReq1 = "EXEC Logistic_markets_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Log_markets, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Logistic_Markets, " & prg.LoginName
gut_Param.Str2 = "EXEC Screen_Csts 'mtnc_log_markets',"
gut_Param.Str3 = "EXEC Logistic_Markets_ins"
gut_Param.Str4 = "EXEC countries_logist_markets_ins"
gut_Param.Str5 = "EXEC Logistic_Markets_del"
gut_Param.Str6 = "EXEC Logistic_Markets_upd"
gut_Param.Str7 = "EXEC countries_logist_markets_ins"
gut_Param.Str8 = "EXEC countries_logist_markets_del"
gut_Param.Str9 = "EXEC countries_logist_markets_t_lst"
gut_Param.Str10 = "EXEC countries_logist_market_t_lst2"
gut_Param.Str11 = "Don't show field"
gut_Param.Str12 = "Show currency"
gut_Param.Str13 = "Don't Show code"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3000
gi_GridWidth(3) = 2500
gi_GridWidth(4) = 1200
gi_GridWidth(5) = 1200
For li_Count = 6 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub


Private Sub mnu_MarkSeg()

Dim li_Count As Integer

gs_TableName = "Market_Segmentation"
gs_ParamReq1 = "EXEC Market_Segmentation_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_markseg, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Market_Segmentation, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 4000
gi_GridWidth(3) = 1000
For li_Count = 4 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
gi_ColumnIFlag = 1
C_main.show 1

End Sub

Private Sub mnu_MSBase()

gs_MenuChoice = "Miscellaneous"
gs_CGCode = "C007"
OptSuperBaseMat

End Sub

Private Sub mnu_Possible()

Dim li_Count As Integer

gs_TableName = "Possible_Area_Comb"
gs_ParamReq1 = "EXEC Possible_Area_Comb_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_poss_area, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Possible_Area_Comb, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 4000
For li_Count = 3 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
gi_ColumnIFlag = 0
C_main.show 1

End Sub

Private Sub mnu_RSBase()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptSuperBaseMat

End Sub
Private Sub mnu_Sale()

Dim li_Count As Integer

gs_TableName = "Sales_Markets"
gs_ParamReq1 = "EXEC Sales_market_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Sales_markets, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Sales_market, " & prg.LoginName
gut_Param.Str2 = "EXEC Screen_Csts 'mtnc_Sales_Markets',"
gut_Param.Str3 = "EXEC Sales_Market_ins"
gut_Param.Str4 = "EXEC countries_sales_markets_ins"
gut_Param.Str5 = "EXEC Sales_Market_del"
gut_Param.Str6 = "EXEC Sales_Market_upd"
gut_Param.Str7 = "EXEC countries_sales_markets_ins"
gut_Param.Str8 = "EXEC countries_sales_markets_del"
gut_Param.Str9 = "EXEC countries_sales_markets_t_lst"
gut_Param.Str10 = "EXEC countries_sales_market_t_lst2"
gut_Param.Str11 = "Show field"
gut_Param.Str12 = "Show currency"
gut_Param.Str13 = "Don't Show code"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3000
gi_GridWidth(3) = 2500
gi_GridWidth(4) = 1200
gi_GridWidth(5) = 1200
gi_GridWidth(6) = 1200
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_MBase()

gs_MenuChoice = "Miscellaneous"
gs_CGCode = "C007"
OptBaseMaterial

End Sub
Private Sub mnu_MColour()

gs_MenuChoice = ""
gs_CGCode = "C007"
OptColour

End Sub
Private Sub mnu_Measure()

Dim li_Count As Integer

gs_TableName = "Measurement_System"
gs_ParamReq1 = "EXEC Measurement_System_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_measyst, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Measurement_System, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1500
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1200
gi_GridWidth(4) = 1200
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Media_type()

gs_TableName = "Media_Type"
gs_ParamReq1 = "EXEC Media_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Media_Type, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Type, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub

Private Sub mnu_MFamily()

gs_MenuChoice = "Miscellaneous"
gs_CGCode = "C007"
OptFamily

End Sub
Private Sub mnu_MGroup()

gs_MenuChoice = "Miscellaneous"
gs_CGCode = "C007"
OptGroup

End Sub
Private Sub mnu_MLabel()

gs_MenuChoice = "Miscellaneous"
gs_CGCode = "C007"
OptLabel

End Sub
Private Sub mnu_MPattern()

gs_MenuChoice = "Miscellaneous"
gs_CGCode = "C007"
OptPattern

End Sub
Private Sub mnu_MSegment()

gs_MenuChoice = "Miscellaneous"
gs_CGCode = "C007"
OptSegment

End Sub
Private Sub mnu_Nature()

Dim li_Count As Integer

gs_TableName = "Claim_Nature"
gs_ParamReq1 = "EXEC Claim_Nature_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_natclai', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Claim_Nature', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1500
gi_GridWidth(4) = 1500
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Objectives()

gs_TableName = "Market_Objectives"
gs_ParamReq1 = "EXEC Media_Market_Objectives_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_objectives, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Market_Objectives, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub
Private Sub mnu_Office()

Dim li_Count As Integer

gs_TableName = "Sales_Offices"
gs_ParamReq1 = "EXEC Sales_Office_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_sales_off, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Sales_Offices, " & prg.LoginName
gi_TranslateType = 8
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1000
gi_GridWidth(2) = 2100
gi_GridWidth(3) = 1200
gi_GridWidth(4) = 1200
gi_GridWidth(5) = 2500
gi_GridWidth(6) = 1200
gi_GridWidth(7) = 1200
For li_Count = 8 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Official()

Dim li_Count As Integer

gs_TableName = "Exchange_Rates"
gs_ParamReq1 = "EXEC Exchange_Rates_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_exratof, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Exchange_Rates, " & prg.LoginName
gi_GridWidth(0) = 1
gi_GridWidth(1) = 2250
gi_GridWidth(2) = 2250
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 2000
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Own()

Dim li_Count As Integer

gs_TableName = "Owner"
gs_ParamReq1 = "EXEC media_Owner_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Owner, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Owner, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 5000
For li_Count = 2 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Plant()

Dim li_Count As Integer

gs_TableName = "Plants"
gs_ParamReq1 = "EXEC Plants_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Plants, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Plants, " & prg.LoginName
gi_TranslateType = 4
gi_GridWidth(0) = 1000
gi_GridWidth(1) = 2100
gi_GridWidth(2) = 1200
gi_GridWidth(3) = 1200
gi_GridWidth(4) = 2500
gi_GridWidth(5) = 500
gi_GridWidth(6) = 1200
gi_GridWidth(7) = 1200
For li_Count = 8 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_PlantContact()

Dim li_Count As Integer

gs_TableName = "Claim_Contact"
gs_ParamReq1 = "EXEC Claim_Contact_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Claim_Cont', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Claim_Contact', '" & prg.LoginName & "'"
gi_TranslateType = 7
gi_GridWidth(0) = 1
gi_GridWidth(1) = 2000
gi_GridWidth(2) = 2000
gi_GridWidth(3) = 1500
gi_GridWidth(4) = 1500
gi_GridWidth(5) = 1500
gi_GridWidth(6) = 1500
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_QonS()

gs_TableName = "Media_Quality_On_Screen"
gs_ParamReq1 = "EXEC Media_Quality_On_Screen_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_quality, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Quality_On_Screen, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub

Private Sub mnu_CM()

    Dim ls_CmdLine As String
    Dim ls_path As String
    Dim ls_FileKey As String
    
    If Not mo_Tools.HasSecurityAlias(prg.LoginName, "Tech_Media") Then
      Call mo_Tools.ShowMsg(aDb, prg.Session_language_Code, 9868, "#You do not have enough rights to do this operation")
      Exit Sub
    End If
    
    If mo_Tools.FindExternalProgram(INI_CAD_MANAGER_WINDOW_NAME, False, True) > 0 Then
        Exit Sub
    End If
    
    ls_FileKey = "CAD_MANAGER"
    
    ls_path = App.Path + "\" & INI_NETAPP_PATH & "\" & INI_CAD_MANAGER_DIR
    
    If mo_Tools.CheckForNewVersion(C_MODULE_NAME, ls_FileKey, INI_CAD_MANAGER_SETUP_EXE, ls_path, INI_CAD_MANAGER_EXE, True) = False Then
        Exit Sub
    End If
                
    ls_CmdLine = """" & ls_path & "\" & INI_CAD_MANAGER_EXE & """ " & prg.CurrentServerIP & prg.ServerInstance & " " & prg.DBName & " " & prg.LoginName & " " & prg.U_PWD & " " & prg.U_Code
    Call mo_Tools.StartExternalProgram(ls_CmdLine, False)

End Sub

Private Sub mnu_WPC()

    Dim ls_CmdLine As String
    Dim ls_path As String
    Dim ls_FileKey As String
    
    If Not mo_Tools.HasSecurityAlias(prg.LoginName, "Tech_WPC") Then
      Call mo_Tools.ShowMsg(aDb, prg.Session_language_Code, 9868, "#You do not have enough rights to do this operation")
      Exit Sub
    End If
    
    If mo_Tools.FindExternalProgram(INI_WPC_WINDOW_NAME, False, True) > 0 Then
        Exit Sub
    End If
    
    ls_FileKey = "WPC"
    
    ls_path = App.Path + "\" & INI_NETAPP_PATH & "\" & INI_WPC_DIR
    
    If mo_Tools.CheckForNewVersion(C_MODULE_NAME, ls_FileKey, INI_WPC_SETUP_EXE, ls_path, INI_WPC_EXE, True) = False Then
        Exit Sub
    End If
                
    ls_CmdLine = """" & ls_path & "\" & INI_WPC_EXE & """ " & prg.CurrentServerIP & prg.ServerInstance & " " & prg.DBName & " " & prg.LoginName & " " & prg.U_PWD & " " & prg.U_Code
    Call mo_Tools.StartExternalProgram(ls_CmdLine, False)

End Sub

Private Sub mnu_RBase()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptBaseMaterial

End Sub
Private Sub mnu_RColour()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptColour

End Sub
Private Sub mnu_Recommand()

Dim li_Count As Integer

gs_TableName = "Claim_Recommendation"
gs_ParamReq1 = "EXEC Claim_Recommendation_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_clairec', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Claim_Recommendation', '" & prg.LoginName & "'"
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 3500
gi_GridWidth(3) = 1500
gi_GridWidth(4) = 1500
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_Reps()

Dim li_Count As Integer

gs_TableName = "Sales_Reps"
gs_ParamReq1 = "EXEC Sales_Reps_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_salreps, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Sales_Reps, " & prg.LoginName
gi_TranslateType = 7
gi_GridWidth(0) = 1
gi_GridWidth(1) = 2800
gi_GridWidth(2) = 1700
gi_GridWidth(3) = 1700
gi_GridWidth(4) = 1700
gi_GridWidth(5) = 1
gi_GridWidth(6) = 1
gi_GridWidth(7) = 1000
gi_GridWidth(8) = 1000
For li_Count = 9 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_RFamily()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptFamily

End Sub
Private Sub mnu_RGroup()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptGroup

End Sub
Private Sub mnu_RLabel()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptLabel

End Sub
Private Sub mnu_RPattern()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptPattern

End Sub
Private Sub mnu_RSegment()

gs_MenuChoice = "Accessories grids"
gs_CGCode = "C004"
OptSegment

End Sub

Private Sub mnu_SemiSpecial()

gs_BIType = "SSTD"
BaseItem_main.show
gl_BaseItemOldHwnd = SetOwner(BaseItem_main.hwnd, frmMain.hwnd)

End Sub


Private Sub mnu_Source_Type()

gs_TableName = "Source_Type"
gs_ParamReq1 = "EXEC Media_Area_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Source_Type, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Area_Type, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub
Private Sub mnu_Special()

gs_TableName = "Base_Item"
gs_BIType = "SPC"
BaseItem_main.show
gl_BaseItemOldHwnd = SetOwner(BaseItem_main.hwnd, frmMain.hwnd)
AllMenuDisabled

End Sub

Private Sub mnu_Standard()

gs_TableName = "Base_Item"
gs_BIType = "STD"
BaseItem_main.show
gl_BaseItemOldHwnd = SetOwner(BaseItem_main.hwnd, frmMain.hwnd)
AllMenuDisabled

End Sub

Private Sub mnu_StrAct_Region()
Dim li_Count As Integer

gs_TableName = "Int_Stract_Region"
gs_ParamReq1 = "EXEC Int_Stract_Region_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_stract_reg, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Stract_region, " & prg.LoginName
gi_TranslateType = 5
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1000
gi_GridWidth(2) = 2100
gi_GridWidth(3) = 1200
gi_GridWidth(4) = 1200
gi_GridWidth(5) = 2500
gi_GridWidth(6) = 1200
gi_GridWidth(7) = 1200
For li_Count = 8 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_Super_Category()

Dim li_Count As Integer

gs_TableName = "Super_Categories"
gs_ParamReq1 = "EXEC Super_Categories_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_supcate, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Super_Categories, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1500
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1000
gi_GridWidth(4) = 1500
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Supplier()

Dim li_Count As Integer

gs_TableName = "Suppliers"
gs_ParamReq1 = "EXEC Suppliers_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_supplie, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Suppliers, " & prg.LoginName
gi_TranslateType = 4
gi_GridWidth(0) = 1000
gi_GridWidth(1) = 2500
gi_GridWidth(2) = 2000
gi_GridWidth(3) = 1000
gi_GridWidth(4) = 1000
gi_GridWidth(5) = 1000
gi_GridWidth(6) = 1000
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_Support()

gs_TableName = "Support"
gs_ParamReq1 = "EXEC Media_Source_Support_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Support, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Source_Support, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub

Private Sub mnu_Territory()

Dim li_Count As Integer

gs_TableName = "Territories"
gs_ParamReq1 = "EXEC Territories_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_territo, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Territories, " & prg.LoginName
gi_TranslateType = 4
gi_GridWidth(0) = 1200
gi_GridWidth(1) = 1800
gi_GridWidth(2) = 1800
gi_GridWidth(3) = 1800
gi_GridWidth(4) = 1000
gi_GridWidth(5) = 1000
For li_Count = 6 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_Sales_Rpt_Area()
    On Error GoTo onError
    
    MouseOff
    
    If mo_RPT_Area_Mtnc Is Nothing Then
        Set mo_RPT_Area_Mtnc = Me.Controls.Add("Project1.RPT_Area_Mtnc", "RPT_Area_Mtnc")
        
        mo_RPT_Area_Mtnc.Visible = False
        Set mo_RPT_Area_Mtnc.ArmDb = aDb
        mo_RPT_Area_Mtnc.Language_Code = gut_LangLogin.Code
        mo_RPT_Area_Mtnc.U_Code = prg.U_Code
        mo_RPT_Area_Mtnc.LoginName = prg.LoginName
        
        Call mo_RPT_Area_Mtnc.Load_A_COM
        Call mo_RPT_Area_Mtnc.Init_control
        If Not mo_RPT_Area_Mtnc.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("RPT_Area_Mtnc")
            Call mo_RPT_Area_Mtnc.Unload_A_COM
            Set mo_RPT_Area_Mtnc = Nothing
            MouseOn
            Exit Sub
        End If
        Call mo_RPT_Area_Mtnc.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_RPT_Area_Mtnc.Resize
        mo_RPT_Area_Mtnc.Visible = True
    End If
    mo_RPT_Area_Mtnc.Visible = True
    Set mo_HandObject = mo_RPT_Area_Mtnc
    
    MouseOn
    Exit Sub
onError:
    MouseOn
    MsgBox "Unable to launch Sales Rpt Area application: " & Err.Description
    If Not mo_RPT_Area_Mtnc Is Nothing Then Call Me.Controls.Remove("RPT_Area_Mtnc")
    Set mo_RPT_Area_Mtnc = Nothing

End Sub



Private Sub mnu_A_CodeTranslator()
    On Error GoTo onError
    
    MouseOff
    
    If mo_Sales_reps_SAP_mtnc Is Nothing Then
        Set mo_Sales_reps_SAP_mtnc = Me.Controls.Add("Project1.Sales_reps_SAP_mtnc", "Sales_reps_SAP_mtnc")
        
        mo_Sales_reps_SAP_mtnc.Visible = False
        Set mo_Sales_reps_SAP_mtnc.ArmDb = aDb
        mo_Sales_reps_SAP_mtnc.Language_Code = gut_LangLogin.Code
        mo_Sales_reps_SAP_mtnc.U_Code = prg.U_Code
        mo_Sales_reps_SAP_mtnc.LoginName = prg.LoginName
        
        Call mo_Sales_reps_SAP_mtnc.Load_A_COM
        Call mo_Sales_reps_SAP_mtnc.Init_control
        If Not mo_Sales_reps_SAP_mtnc.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("Sales_reps_SAP_mtnc")
            Call mo_Sales_reps_SAP_mtnc.Unload_A_COM
            Set mo_Sales_reps_SAP_mtnc = Nothing
            MouseOn
            Exit Sub
        End If
        Call mo_Sales_reps_SAP_mtnc.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_Sales_reps_SAP_mtnc.Resize
        mo_Sales_reps_SAP_mtnc.Visible = True
    End If
    mo_Sales_reps_SAP_mtnc.Visible = True
    Set mo_HandObject = mo_Sales_reps_SAP_mtnc
    
    MouseOn
    Exit Sub
onError:
    MouseOn
    MsgBox "Unable to launch Sales Rpt Area application: " & Err.Description
    If Not mo_Sales_reps_SAP_mtnc Is Nothing Then Call Me.Controls.Remove("Sales_reps_SAP_mtnc")
    Set mo_Sales_reps_SAP_mtnc = Nothing

End Sub


Private Sub mnu_TestCategory()

Dim li_Count As Integer

gs_TableName = "Test_Category"
gs_ParamReq1 = "EXEC Test_Category_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Test_Category, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Test_Category, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 4000
gi_GridWidth(3) = 1200
gi_GridWidth(4) = 1200
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_TestHouse()

Dim i As Integer

gs_TableName = "Test_House"
gs_ParamReq1 = "EXEC Test_House_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Test_House, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Test_House, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 2000
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 2000
gi_GridWidth(5) = 1200
gi_GridWidth(6) = 1200

For i = 7 To 29
    gi_GridWidth(i) = 1
Next i
C_main.show 1

End Sub

Private Sub mnu_TestHouseAcred()
Dim i As Integer

gs_TableName = "Test_House_Acred"
gs_ParamReq1 = "EXEC Test_House_Acred_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Test_THOA', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Test_THOA', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 1
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 2000
gi_GridWidth(5) = 2000
gi_GridWidth(6) = 1200
gi_GridWidth(7) = 1200

For i = 8 To 29
    gi_GridWidth(i) = 1
Next i
C_main.show 1

End Sub



Private Sub mnu_TestMarket()

Dim li_Count As Integer

gs_TableName = "Test_Market"
gs_ParamReq1 = "EXEC Test_Market_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Test_Mark, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Test_Market, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 1
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 2000
gi_GridWidth(5) = 1200
gi_GridWidth(6) = 1200
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_TestStandard()

Dim li_Count As Integer

gs_TableName = "Test_Standard"
gs_ParamReq1 = "EXEC Test_Standard_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Test_Stand, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Test_Standard, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 1750
gi_GridWidth(3) = 1
gi_GridWidth(4) = 2000
gi_GridWidth(5) = 1200
gi_GridWidth(6) = 1200
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_TestType()

Dim li_Count As Integer

gs_TableName = "Test_Type"
gs_ParamReq1 = "EXEC Test_Type_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Test_Type, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Test_Type, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 3000
gi_GridWidth(2) = 1
gi_GridWidth(3) = 1
gi_GridWidth(4) = 3000
gi_GridWidth(5) = 1250
gi_GridWidth(6) = 1250
For li_Count = 7 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_TOM()

gs_TableName = "Type_Of_Memo"
gs_ParamReq1 = "EXEC Media_Type_Of_Memo_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Memo_Type, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Type_Of_Memo, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub

Private Sub mnu_typ_condition()
Dim i As Integer

gs_TableName = "Test_Typ_Condition"
gs_ParamReq1 = "EXEC Test_Typ_Condition_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts 'main_Tst_TypCnd', '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security 'Test_Typ_Condition', " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1
gi_GridWidth(1) = 1
gi_GridWidth(2) = 2000
gi_GridWidth(3) = 2000
gi_GridWidth(4) = 1200
gi_GridWidth(5) = 1
For i = 6 To 29
    gi_GridWidth(i) = 1
Next i
' columns of the internet flag
gi_ColumnIFlag = 1
C_main.show 1

End Sub

Private Sub mnu_Unit()

Dim li_Count As Integer

gs_TableName = "Unit_Of_Measure"
gs_ParamReq1 = "EXEC Unit_Of_Measure_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_UniMeas, '" & gut_LangLogin.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Unit_Of_Measure, " & prg.LoginName
gi_TranslateType = 1
gi_GridWidth(0) = 1500
gi_GridWidth(1) = 1
gi_GridWidth(2) = 5000
gi_GridWidth(3) = 1000
gi_GridWidth(4) = 1500
For li_Count = 5 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub mnu_Value(ByVal as_caption As String)

gut_Param.Str1 = as_caption         ' mnu_Value.Caption
gut_Param.Str2 = "TTV"
SubMenu.show 1

End Sub
Private Sub mnu_View()

gs_TableName = "Type_Of_View"
gs_ParamReq1 = "EXEC Media_Type_Of_View_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Media_Type_Of_View, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Type_Of_View, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub
Private Sub mnu_Viewer()

Dim li_Count As Integer

gs_TableName = "Viewer"
gs_ParamReq1 = "EXEC media_Viewer_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Viewer, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security media_Viewer, " & prg.LoginName
gi_GridWidth(0) = 1
gi_GridWidth(1) = 4000
gi_GridWidth(2) = 4500
For li_Count = 3 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub
Private Sub mnu_VO()

gs_TableName = "Visible_On"
gs_ParamReq1 = "EXEC Media_Displays_t_lst '"
gs_ParamReq2 = "EXEC Screen_Csts main_Visible_On, '" & gut_LangWork.Code & "'"
gs_ParamReq3 = "EXEC Check_Security Media_Displays, " & prg.LoginName
gi_TranslateType = 1
OptMultiDesc

End Sub


Private Sub mnu_WBase()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptBaseMaterial

End Sub

Private Sub mnu_WBI_Marketing()

MouseOff
gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptBI_Marketing
MouseOn

End Sub

Private Sub mnu_WColour()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptColour

End Sub

Private Sub mnu_WDim()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptDimension

End Sub
Private Sub mnu_WFamily()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptFamily

End Sub
Private Sub mnu_WGroup()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptGroup

End Sub

Private Sub mnu_WHeight()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptHeight

End Sub
Private Sub mnu_WLabel()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptLabel

End Sub

Private Sub mnu_WModule()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptModule

End Sub

Private Sub mnu_WPattern()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptPattern

End Sub
Private Sub mnu_WSBase()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptSuperBaseMat

End Sub
Private Sub mnu_WSegment()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptSegment

End Sub

Private Sub mnu_WSurface()

gs_MenuChoice = "Walls"
gs_CGCode = "C006"
OptSurface

End Sub
 
Private Sub QuotationOutLine_EvtActionAdd()
    Quotation_AddNew QuotationOutLine.l_LeftView, QuotationOutLine.l_TopView
End Sub

Private Sub QuotationOutLine_EvtActionLooseSelection()
    'We close all views
    Quotation_ChangeView -2, 0, 0
    MouseOn
End Sub

Private Sub QuotationOutLine_EvtActionNodeClick()
    'We close all views
    Quotation_ChangeView -2, 0, 0
    MouseOn
End Sub

Private Sub QuotationOutLine_EvtFormClose()
    'We close all views
    Quotation_ChangeView -2, 0, 0
    AllMenuEnabled
    Set QuotationOutLine = Nothing
    MouseOn
End Sub

Private Sub QuotationOutLine_EvtActionChangeView(ByVal li_NewView As Integer)
    Quotation_ChangeView li_NewView, QuotationOutLine.l_LeftView, QuotationOutLine.l_TopView
End Sub

Private Sub QuotationOutLine_EvtActionLeafClick(ByVal ls_OutLineCode As String, ByVal ls_OutlineDesc As String)
    Quotation_Change ls_OutLineCode, ls_OutlineDesc, QuotationOutLine.l_LeftView, QuotationOutLine.l_TopView
End Sub



Private Sub QuotationOutLine_EvtSearch(ls_OutLineCode As String)
Dim ls_LastTableName As String
    MouseOff
    ls_LastTableName = gs_TableName
    gs_TableName = "Quotation"
    BaseItem_search.show 1
    ls_OutLineCode = gs_Path
    gs_TableName = ls_LastTableName
    MouseOn
End Sub







'Private Sub TestOutLine_EvtActionChangeView(ByVal li_NewView As Integer)
'    Test_ChangeView li_NewView, TestOutLine.l_LeftView, TestOutLine.l_TopView
'End Sub

'Private Sub TestOutLine_EvtActionLeafClick(ByVal ls_OutLineCode As String, ByVal ls_OutlineDesc As String)
'    Test_Change ls_OutLineCode, ls_OutlineDesc, TestOutLine.l_LeftView, TestOutLine.l_TopView
'End Sub

'Private Sub TestOutLine_EvtActionNodeClick()
    'We close all views
'    Test_ChangeView -2, 0, 0
'    MouseOn
'End Sub

'Private Sub TestOutLine_EvtActionOptionalAdd(ByVal li_OptionNumber As Integer)
'    Test_OutlineWithoutViewAdd li_OptionNumber
'End Sub

'Private Sub TestOutLine_EvtFormClose()
    'We close all views
'    Test_ChangeView -2, 0, 0
'    AllMenuEnabled
'    Set TestOutLine = Nothing
'    MouseOn
'End Sub

'Private Sub TestOutLine_EvtSearch(ls_OutLineCode As String)
'Dim ls_LastTableName As String
'    MouseOff
'    ls_LastTableName = gs_TableName
'    gs_TableName = "TestManager"
'    BaseItem_search.show 1
'    ls_OutLineCode = gs_Path
'    gs_TableName = ls_LastTableName
'    MouseOn
'End Sub

Private Sub GetCaptions()

Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Field As String
Dim ls_Text As String
Dim ls_Perm As String
Dim lo_mnuCtrl As VB.Menu
   
On Error GoTo suite
   
ls_req = "EXEC Screen_Csts_Secure 'PROD020', " & gut_LangLogin.Code
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
    Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            ls_Field = ODBCData(ll_Statement, 1)
            ls_Text = ODBCData(ll_Statement, 2)
            ls_Perm = ODBCData(ll_Statement, 3)
            Select Case ls_Field
            Case "title": Caption = ls_Text
            Case "P", "S", "R", "Q", "A":
                Set lo_mnuCtrl = GetMenuCtrl(mnu_mainMenu, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
                lo_mnuCtrl.Enabled = CBool(ls_Perm)
                Case "PST", "PSP", "PSE", "METALCMP", "QFASP", "MNUQSE":
                    Set lo_mnuCtrl = GetMenuCtrl(mnu_subProducts, ls_Field)
                    lo_mnuCtrl.Caption = ls_Text
                    lo_mnuCtrl.Enabled = CBool(ls_Perm)
                Case "SRM", "IVPO"
                    Set lo_mnuCtrl = GetMenuCtrl(mnu_SubPurchasing, ls_Field)
                    lo_mnuCtrl.Caption = ls_Text
                    lo_mnuCtrl.Enabled = CBool(ls_Perm)
                Case "MNUCD", "RC", "DCLOAD", "QT", "WF", "INT", "MNUE", "MNUCG", "MNUHR", "MNUCDB", "DPC":
                    Set lo_mnuCtrl = GetMenuCtrl(mnu_subSystems, ls_Field)
                    lo_mnuCtrl.Caption = ls_Text
                    lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    Case "C", "CREP", "GD", "GMan", "GT", "N", "LC", "CR":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subClaims, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    Case "MNUDCC", "MNUDCW", "MNUDCO", "MNUDCU", "MNUDCI", "MNUDCR", "MNUDCE", "MNUDCCE", "MNUDCIE", "MNUDCRE", "MNUDCCT", "MNUDCET", "MNUDCUOM", "MNUDCINV", "MNUDCREP", "MNUDCPL", "MNUDCPL_T"
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subDC, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)

                    
                        Case "CRSC": FillGrid "CREP", ls_Field, ls_Text, ls_Perm, 0
                        Case "CRNA": FillGrid "CREP", ls_Field, ls_Text, ls_Perm, 1
                        Case "CRSR": FillGrid "CREP", ls_Field, ls_Text, ls_Perm, 2
                        Case "CROC": FillGrid "CREP", ls_Field, ls_Text, ls_Perm, 3
                        Case "CRTS": FillGrid "CREP", ls_Field, ls_Text, ls_Perm, 4
                        
                        Case "ENSCOMP": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 0
                        Case "ENSECTYP": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 1
                        Case "ENSECMFG": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 2
                        Case "ENSECPT": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 3
                        Case "ENSEIO": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 4
                        Case "ENSELG": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 5
                        Case "ENSENR": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 6
                        Case "ENSEPR": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 7
                        Case "ENSEPJS": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 8
                        Case "ENSEPJT": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 9
                        Case "ENSEREA": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 10
                        Case "ENSESPS": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 11
                        Case "ENSETOA": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 12
                        Case "ENSEEAG": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 13
                        Case "ENSEEAT": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 14
                        Case "ENSELAG": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 15
                        Case "ENSEED": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 16
                        Case "ENSEEE": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 17
                        Case "ENSEEO": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 18
                        Case "ENSEER": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 19
                        Case "ENSESA": FillGrid "ENSEUR", ls_Field, ls_Text, ls_Perm, 20
                    
                        Case "ENSEAT": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 0
                        Case "ENSLCTYP": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 1
                        Case "ENSLCMFG": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 2
                        Case "ENSLCPTYP": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 3
                        Case "ENSLIO": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 4
                        Case "ENSLLG": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 5
                        Case "ENSLNR": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 6
                        Case "ENSLPEO": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 7
                        Case "ENSLPG": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 8
                        Case "ENSLPN": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 9
                        Case "ENSLPR": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 10
                        Case "ENSLPJS": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 11
                        Case "ENSLPJT": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 12
                        Case "ENSLREA": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 13
                        Case "ENSLSPS": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 14
                        Case "ENSLTOA": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 15
                        Case "ENSLD": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 16
                        Case "ENSLE": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 17
                        Case "ENSLO": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 18
                        Case "ENSLR": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 19
                        Case "CONVERT": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 20
                        Case "ENSLSA": FillGrid "ENSLOC", ls_Field, ls_Text, ls_Perm, 21
                
                    
                    Case "IHBM": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 0
                    Case "ICC": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 1
                    Case "ICL": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 2
                    Case "IVT": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 3
                    Case "ICOUNT": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 4
                    Case "IPG": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 5
                    Case "IPCW": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 6
                    Case "IGLO": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 7
                    Case "ICA": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 8
                    Case "IOFTYP": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 9
                    Case "IOFINT": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 10
                    Case "IAREA": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 11
                    Case "IPFG": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 12
                    Case "IAPFG": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 13
            'Case "IPFGDGG": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 14
            'Case "IAPFGDGG": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 15
            Case "IPFPE": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 14
            Case "IDGG": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 15
            Case "ICIG": FillGrid "INT", ls_Field, ls_Text, ls_Perm, 16
                Case "MDLPFG": FillGrid "MDL", ls_Field, ls_Text, ls_Perm, 0
                Case "MDLAPFG": FillGrid "MDL", ls_Field, ls_Text, ls_Perm, 1
                Case "MDLDGG": FillGrid "MDL", ls_Field, ls_Text, ls_Perm, 2
                Case "MDLINM": FillGrid "MDL", ls_Field, ls_Text, ls_Perm, 3
                Case "MDLCIG": FillGrid "MDL", ls_Field, ls_Text, ls_Perm, 4
                
                Case "QTM", "QTC", "QTHF", "QTLR", "MNUQS", "MNUQB", "MNUQF", "MNUQM", "MNUQG", "MNUQP", "MNUQE", "MNUQA"
                    Set lo_mnuCtrl = GetMenuCtrl(mnu_subQuotation, ls_Field)
                    lo_mnuCtrl.Caption = ls_Text
                    lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    
                Case "G", "RP", "F", "AD", "M", "TE", "SA", "MNUEST", "SAR", "I", "CDB2":
                    Set lo_mnuCtrl = GetMenuCtrl(mnu_subRefTables, ls_Field)
                    lo_mnuCtrl.Caption = ls_Text
                    lo_mnuCtrl.Enabled = CBool(ls_Perm)

                    Case "CO", "PL", "D", "GM", "ME", "U", "Cust":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subGeneral, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    
                    Case "CE", "GR", "W", "AC", "AG", "AW", "MI", "RPP":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subRefTabProducts, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                        
                        Case "PS", "PE", "PP", "PO", "PF", "SZ", "PG", "PH", "PSB", "PB", "PR", "BIM", "GO", "MNUFS", "MNULS", "MNUSS", "MRC", "CTD", "CTMRI", "MINL", "MAXL", "PRF", "PRFSH", "CPT", "FORM":
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subCeilings, ls_Field)
                            If Not lo_mnuCtrl Is Nothing Then
                                lo_mnuCtrl.Caption = ls_Text
                                lo_mnuCtrl.Enabled = CBool(ls_Perm)
                            End If
                            
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subGrids, ls_Field)
                            If Not lo_mnuCtrl Is Nothing Then
                                lo_mnuCtrl.Caption = ls_Text
                                lo_mnuCtrl.Enabled = CBool(ls_Perm)
                            End If
                            
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subWalls, ls_Field)
                            If Not lo_mnuCtrl Is Nothing Then
                                lo_mnuCtrl.Caption = ls_Text
                                lo_mnuCtrl.Enabled = CBool(ls_Perm)
                            End If
                                
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subAccessCeilings, ls_Field)
                            If Not lo_mnuCtrl Is Nothing Then
                                lo_mnuCtrl.Caption = ls_Text
                                lo_mnuCtrl.Enabled = CBool(ls_Perm)
                            End If
                                
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subAccessGrids, ls_Field)
                            If Not lo_mnuCtrl Is Nothing Then
                                lo_mnuCtrl.Caption = ls_Text
                                lo_mnuCtrl.Enabled = CBool(ls_Perm)
                            End If
                                
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subAccessWalls, ls_Field)
                            If Not lo_mnuCtrl Is Nothing Then
                                lo_mnuCtrl.Caption = ls_Text
                                lo_mnuCtrl.Enabled = CBool(ls_Perm)
                            End If
                                
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subMiscellaneous, ls_Field)
                            If Not lo_mnuCtrl Is Nothing Then
                                lo_mnuCtrl.Caption = ls_Text
                                lo_mnuCtrl.Enabled = CBool(ls_Perm)
                            End If
                                
                            Case "PM", "PHE", "PD":
                                Set lo_mnuCtrl = GetMenuCtrl(mnu_subSizes, ls_Field)
                                If Not lo_mnuCtrl Is Nothing Then
                                    lo_mnuCtrl.Caption = ls_Text
                                    lo_mnuCtrl.Enabled = CBool(ls_Perm)
                                End If
                                
                                Set lo_mnuCtrl = GetMenuCtrl(mnu_subWallsSize, ls_Field)
                                If Not lo_mnuCtrl Is Nothing Then
                                    lo_mnuCtrl.Caption = ls_Text
                                    lo_mnuCtrl.Enabled = CBool(ls_Perm)
                                End If

                        Case "Mnu_Samples", "MNUC", "RPTV", "CREP", "REPTOOL", "SPAA", "CAPCLEAN", "CAPACT":
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subCapture, ls_Field)
                            lo_mnuCtrl.Caption = ls_Text
                            lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    
                    
                    Case "CU", "E":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subFinance, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    
                    Case "B", "O":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subExchange, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    
                    Case "ASSOCF", "MD", "MNURA", "MNURP":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subAdvertising, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                        
                    Case "MM", "MDP", "MC1", "MC2", "VO", "TV", "TOM", "Interest", "SourceT", "ST", "OWN", "AO", "DEF", "QONS":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subMedMan, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    
                    Case "MS", "RE", "RAL", "RAM":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subRecArea, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    
                    Case "MN", "BUL":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subMarketing, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
'                        mnu_News.Enabled = CBool(ls_Perm)
'                        mnu_bulletin.Enabled = CBool(ls_Perm)
                    Case "CA", "SC", "SU", "LM", "WPC":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subMarketing, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                        
                    Case "TT", "TTV", "CM":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subTechnical, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                        
                        Case "TTM", "TSMICH", "TTK", "TTC", "TTT", "TRT", "TTS", "TTH", "TTHA", "TTCT", "TTCD", "TTRD":
                            Set lo_mnuCtrl = GetMenuCtrl(mnu_subTest, ls_Field)
                            lo_mnuCtrl.Caption = ls_Text
                            lo_mnuCtrl.Enabled = CBool(ls_Perm)
                            
                        Case "TVAA": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 0
'task 789                        Case "TVAC": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 2
                        Case "TVAD": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 3
                        Case "TVAN": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 1
                        Case "TVAR": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 4
' TM task 789 (3 next)
                        Case "TVAF": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 5 ' Sound attenuation Dnfw
                        Case "TVAK": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 6 ' Sound absortion class
                        Case "TVRI": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 7 ' Sound reduction index
                        Case "TVESAA": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 8 ' Equivalent Sound Absorption Area (Sabines)
                        Case "TVFA": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 9
                        Case "TVFE": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 10
                        Case "TVD": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 11
                        Case "TVH": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 12
                        Case "TVY": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 13
                        Case "TVI": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 14
                        Case "TVL": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 15
                        Case "TVT": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 16
                        Case "TVW": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 17
                        Case "TVWE": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 18
                        Case "TVPL": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 19
' JUNA task213 Begin
                        Case "TVRC": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 20 ' Recycled content
                        Case "TVAQ": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 21 ' Air Quality
                        Case "TVC": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 22  ' Cleanable
                        Case "TVAM": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 23 ' Anti-Microbial
' JUNA task213 End
'task 789
                        Case "TVRN": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 24 ' Rain noise test
' JUNA New published values 4/2/2015
                        Case "TVRP": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 25 ' In Armstrong Recycling Program
                        Case "TVFEM": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 26 ' Formaldehyde Emissions
                        Case "TVVOC": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 27 ' VOC emissions
                        Case "TVC2C": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 28 ' C2C Certified
                        Case "TVEPD": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 29 ' Environmental Product Declaration (EPD)
                        Case "TVRC2": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 30 ' Recyclable%
                        Case "TVDCL": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 31 ' Dry cleaning
                        Case "TVMCL": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 32 ' Moist cleaning
                        Case "TVSCL": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 33 ' Damp sponge cleaning
                        Case "TVSCRB": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 34 'Scrubbable
                        Case "TVHPCL": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 35 'High pressure cleaning
                        Case "TVDSR": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 36 ' Disinfectant resistant
                        Case "TVSIC": FillGrid "TTV", ls_Field, ls_Text, ls_Perm, 37 ' Seismic component
    

                    
                    Case "SO", "SR", "SRA", "TR", "SM", "SPR", "SRPTA", "SACR":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subSales, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
' JN 11.7.2013 added view selection into SR assignement
                    Case "SRACLM": FillGrid "SRA", ls_Field, ls_Text, ls_Perm, 0 ' Claim View
                    Case "SRASAP": FillGrid "SRA", ls_Field, ls_Text, ls_Perm, 1 ' Actual SAP sales
                    Case "SRAINT": FillGrid "SRA", ls_Field, ls_Text, ls_Perm, 2 ' Insentive View
                    
                    Case "V", "MT", "FE", "CC", "PC":
                        Set lo_mnuCtrl = GetMenuCtrl(mnu_subIT, ls_Field)
                        lo_mnuCtrl.Caption = ls_Text
                        lo_mnuCtrl.Enabled = CBool(ls_Perm)
                        
                Case "QP", "QC", "QS", "MNUQT":
                    Set lo_mnuCtrl = GetMenuCtrl(mnu_subQueries, ls_Field)
                    lo_mnuCtrl.Caption = ls_Text
                    lo_mnuCtrl.Enabled = CBool(ls_Perm)
                    
                Case "T", "TI", "NTI", "MNUGT":
                    Set lo_mnuCtrl = GetMenuCtrl(mnu_subAbout, ls_Field)
                    lo_mnuCtrl.Caption = ls_Text
                    lo_mnuCtrl.Enabled = CBool(ls_Perm)
                Case "password":
                    Set lo_mnuCtrl = GetMenuCtrl(mnu_subAbout, ls_Field)
                    lo_mnuCtrl.Caption = ls_Text
            Case "GEMA":
                Set lo_mnuCtrl = GetMenuCtrl(mnu_subSystems, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
            Case "EAS":
                Set lo_mnuCtrl = GetMenuCtrl(mnu_subSystems, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
            Case "EASCLIENT", "EASVIEWER":
                Set lo_mnuCtrl = GetMenuCtrl(mnu_SubEAS, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
            Case "TIMEMGMT":
                Set lo_mnuCtrl = GetMenuCtrl(mnu_subSystems, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
            Case "GEMASOM", "GEMARATE":
                Set lo_mnuCtrl = GetMenuCtrl(mnu_SubGEMA, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
            Case "MSA":
                Set lo_mnuCtrl = GetMenuCtrl(mnu_subSystems, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
            Case "CAP_OFFERPROD", "CAP_OFFERTEMP", "DPC_REF", "DPC_REF_2", "DPC_REF_SYS", "DPC_REF_BOR", "DPC_REF_BOM", "DPC_REF_SUB", "DPC_REF_PRICES", "DPC_REF_PDFGENERATOR":
                Set lo_mnuCtrl = GetMenuCtrl(mnu_SubDPC, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
            Case "ONSV_RPT", "ONSV_BDG", "ONSV_GSV", "ONSV_MG", "ONSV_BMK"
                Set lo_mnuCtrl = GetMenuCtrl(mnu_subONSV, ls_Field)
                lo_mnuCtrl.Caption = ls_Text
            End Select
        End If
    Loop
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
GridSort GRD_SubMenu, Array(4), Array(OK), 0
MouseOn
Exit Sub

suite:
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
StdError
End Sub
Private Sub OptMultiDesc()

Dim li_Count As Integer

gi_GridWidth(0) = 1
gi_GridWidth(1) = 5000
For li_Count = 2 To 29
    gi_GridWidth(li_Count) = 1
Next li_Count
C_main.show 1

End Sub

Private Sub FillButtons()
Dim li_Width As Integer
Dim li_Height As Integer
Dim li_top As Integer
Dim i As Integer


'    ' Me.Caption = Me.Caption & " – Version : " & App.Major & "." & App.Minor & "." & App.Revision & " [" & prg.LoginName & " - " & gut_LangLogin.Desc & "]"


    'If the form is minimized, we make nothing
    If frmMain.WindowState = 1 Then Exit Sub
    
    'If the form is too little, we resize it
    If Me.Width < 5000 Then Me.Width = 5000
    If Me.Height < 4000 Then Me.Height = 4000

'    'Calcul of the button size
'    li_Width = CInt(Me.ScaleWidth / 6.2)
'    li_Height = 500
'    li_top = Me.ScaleHeight - li_Height
'
'    'bottom_bar.Width = Me.ScaleWidth
'    'bottom_bar.Height = li_Height
'    'bottom_bar.Top = li_top
'
''    ssp_Date.Width = li_Width
''    ssp_Date.Height = li_Height
''    ssp_Date.Caption = Format(Now, "Short Date") & "    " & Format(Now, "Short Time")
'
'    ssp_Language.Width = li_Width
'    ssp_Language.Height = li_Height
'    ssp_Language.Left = li_Width
'    ssp_Language.Caption = gut_LangLogin.Desc
'
'    SSP_Password.Width = li_Width
'    SSP_Password.Height = li_Height
'    SSP_Password.Left = 2 * li_Width - 1
'
''    ssp_Plus.Width = li_Width / 5
''    ssp_Plus.Height = li_Height
''    ssp_Plus.Left = 3 * li_Width - 1
''    ssp_Plus.Caption = "+"
'
''    ssp_Bits.Width = li_Width
''    ssp_Bits.Height = li_Height
''    ssp_Bits.Left = 3.2 * li_Width - 1
''    ssp_Bits.Caption = Environment
'
'    ssp_Version.Width = li_Width
'    ssp_Version.Height = li_Height
'    ssp_Version.Left = 4.2 * li_Width - 1
'    ssp_Version.Caption = "Version : " & App.Major & "." & App.Minor & "." & App.Revision
   
'    ssp_Screen.Width = Me.ScaleWidth - (5.2 * li_Width)
'    ssp_Screen.Height = li_Height
'    ssp_Screen.Left = 5.2 * li_Width - 1
'    ssp_Screen.Caption = gl_DataBaseType
    
    Zone_Client.Left = 0
    Zone_Client.Top = 0
    Zone_Client.Width = Width
    Zone_Client.Height = li_top - 10
    
End Sub

Friend Sub AllMenuEnabled()
    Dim lo_menu As VB.Menu
    For Each lo_menu In mnu_mainMenu
        lo_menu.Enabled = OK
    Next
End Sub

Friend Sub AllMenuDisabled()
    Dim lo_menu As VB.Menu
    For Each lo_menu In mnu_mainMenu
        lo_menu.Enabled = KO
    Next
End Sub



Private Function Launch_Capture() As Boolean

    On Error GoTo onError
    MouseOff
    Launch_Capture = False
    
    If Capture Is Nothing Then
        Set Capture = Me.Controls.Add("Project1.A_Capture", "Capture")
        Capture.Connect_Server = prg.CurrentServerIP & prg.ServerInstance
        Capture.Connect_Database = prg.DBName
        Capture.Ucode = prg.U_Code
        Capture.Connect_Login = prg.LoginName
        Capture.Connect_Password = prg.U_PWD
        Capture.Connect_Application = "Capture Online"
        Capture.Connect_Language = ""
        Capture.Initialize_Trace
        Set Capture.ArmDb = aDb
        Set Capture.Tools = mo_Tools
        Call Capture.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        If Not Capture.Load_A_COM Then
            MsgBox "Unable to launch Capture"
            Call Capture.Unload_A_COM
            GoTo onError
        End If
    End If
    
    Capture.Visible = True
    Set mo_HandObject = Capture
    
    Launch_Capture = True
    MouseOn
    Exit Function
    
onError:
    MouseOn

    If Not Capture Is Nothing Then
        Call Me.Controls.Remove("Capture")
        Set Capture = Nothing
    End If
    Call ErrorHandler("Launch_Capture")
End Function


Private Function Launch_samples() As Boolean

    On Error GoTo onError1
    MouseOff
    
    If Samples Is Nothing Then
        Set Samples = Me.Controls.Add("Project1.DSW", "Samples")
        
        
   'Samples.Visible = True
    Set Samples.Db = aDb
    Samples.Language = prg.Session_language_Code
    Samples.Use_by_DSW = False
    Samples.user_info = prg.LoginName
'    Call Capture.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        If Not Samples.Load_A_COM Then
            MsgBox "Unable to launch Samples"
            Call Samples.Unload_A_COM
            GoTo onError1
        End If
    End If
    
    Samples.Visible = True
    Set mo_HandObject = Samples
    
    Launch_samples = True
    MouseOn
    Exit Function
    
onError1:
    MouseOn
    If Not Samples Is Nothing Then
        Call Me.Controls.Remove("Samples")
        Set Samples = Nothing
    End If
    Launch_samples = False
End Function



Private Function Launch_assfiles() As Boolean

    On Error GoTo onError1
    MouseOff
    
    If ref_blob Is Nothing Then
    
    ' Check rights
        If Not HaveRight("ASSFILESUSR") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
        
        Dim lo_FSO As Object
        Set lo_FSO = CreateObject("Scripting.FileSystemObject")
        If lo_FSO Is Nothing Then
            MouseOn
            MsgBox "Cannot create Scripting.FileSystemObject."
            Exit Function
        End If
        Set ref_blob = Me.Controls.Add("Project1.blobedit", "Ref_Blob")
        Set ref_blob.Db = aDb
        Set ref_blob.fso = lo_FSO
        ' set language for UI
        ref_blob.Language_Code = prg.Session_language_Code
        ref_blob.U_Code = prg.U_Code
        If Not ref_blob.Load_A_COM Then
            MsgBox "Unable to launch associated files"
            Call ref_blob.Unload_A_COM
            Set lo_FSO = Nothing
            GoTo onError1
        End If
    End If
     
    ref_blob.Visible = True
    Set mo_HandObject = ref_blob
    Set lo_FSO = Nothing

    Launch_assfiles = True
    MouseOn
    Exit Function
    
onError1:
    MouseOn
    If Not ref_blob Is Nothing Then
        Call Me.Controls.Remove("Ref_Blob")
        Set ref_blob = Nothing
    End If
    Launch_assfiles = False
End Function
Private Function Launch_hr() As Boolean

    On Error GoTo errorhr
    MouseOff
    
    If hr_ctl Is Nothing Then
        
        If Not HaveRight("HRUSR") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
        
        Set hr_ctl = Me.Controls.Add("Project1.hr", "hr_CTL")
        Set hr_ctl.ArmDb = aDb
    
        ' set language for UI
        hr_ctl.Language_Code = prg.Session_language_Code
        hr_ctl.U_Code = prg.U_Code
    
        If Not hr_ctl.Load_A_COM Then
            MsgBox "Unable to launch HR Component"
            Call hr_ctl.Unload_A_COM
            GoTo errorhr
        End If
    End If
     
    hr_ctl.Visible = True
    Set mo_HandObject = hr_ctl
    

    Launch_hr = True
    MouseOn
    Exit Function
    
errorhr:
    MouseOn
    If Not hr_ctl Then
        Call Me.Controls.Remove("hr_CTL")
    End If
    Set hr_ctl = Nothing
    Launch_hr = False
    
End Function

Private Function Launch_RefProject() As Boolean

    On Error GoTo onError1
    MouseOff
    
    If RefProject Is Nothing Then
        ' Check rights
        If Not HaveRight("REFPRJUSR") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
        
        
        Set RefProject = Me.Controls.Add("Project1.sfbrefpro", "RefProject")
        Set RefProject.ArmDb = aDb
        ' set language for UI
        RefProject.Language_Code = prg.Session_language_Code
        RefProject.U_Code = prg.U_Code
        
        ' set connection string mw 27.8.2008
        RefProject.ConnectString = prg.CurrentServerIP & prg.ServerInstance & CH_LDELIMIT & prg.DBName & CH_LDELIMIT & prg.LoginName & CH_LDELIMIT & prg.U_PWD & CH_LDELIMIT & "RefProject"
    
        If Not RefProject.Load_A_COM Then
            MsgBox "Unable to launch References Projects"
            Call RefProject.Unload_A_COM
            GoTo onError1
        End If
    End If
     
    RefProject.Visible = True
    Set mo_HandObject = RefProject

    Launch_RefProject = True
    MouseOn
    Exit Function
    
onError1:
    MouseOn
    If Not RefProject Is Nothing Then
        Call Me.Controls.Remove("RefProject")
        Set RefProject = Nothing
    End If
    Launch_RefProject = False
End Function


Private Sub HideHandObject()
On Error GoTo ErrHandler
 
  If Not mo_HandObject Is Nothing Then
    mo_HandObject.Visible = False
    
    If mo_HandObject Is mo_DPC_Ref Then
      Call Me.Controls.Remove("DPC_Ref")
      Call mo_DPC_Ref.Unload_A_COM
      Set mo_DPC_Ref = Nothing
    End If
    
    If mo_HandObject Is mo_DPC_Ref_2 Then
      Call Me.Controls.Remove("DPC_Ref_2")
      Call mo_DPC_Ref_2.Unload_A_COM
      Set mo_DPC_Ref_2 = Nothing
    End If
    
    If mo_HandObject Is mo_DPC_Ref_Sys Then
      Call Me.Controls.Remove("DPC_Ref_Sys")
      Call mo_DPC_Ref_Sys.Unload_A_COM
      Set mo_DPC_Ref_Sys = Nothing
    End If
    
    If mo_HandObject Is mo_DPC_Ref_Bor Then
      Call Me.Controls.Remove("DPC_Ref_Bor")
      Call mo_DPC_Ref_Bor.Unload_A_COM
      Set mo_DPC_Ref_Bor = Nothing
    End If
    
    If mo_HandObject Is mo_DPC_Ref_Bom Then
      Call Me.Controls.Remove("DPC_Ref_Bom")
      Call mo_DPC_Ref_Bom.Unload_A_COM
      Set mo_DPC_Ref_Bom = Nothing
    End If
    
    If mo_HandObject Is mo_DPC_Ref_Sub Then
      Call Me.Controls.Remove("DPC_Ref_Sub")
      Call mo_DPC_Ref_Sub.Unload_A_COM
      Set mo_DPC_Ref_Sub = Nothing
    End If
    
    If mo_HandObject Is mo_DPC_Ref_Prices Then
      Call Me.Controls.Remove("DPC_Ref_Prices")
      Call mo_DPC_Ref_Prices.Unload_A_COM
      Set mo_DPC_Ref_Prices = Nothing
    End If
    
    If mo_HandObject Is mo_DPC_Ref_PDFGenerator Then
      Call Me.Controls.Remove("DPC_Ref_PDFGenerator")
      Call mo_DPC_Ref_PDFGenerator.Unload_A_COM
      Set mo_DPC_Ref_PDFGenerator = Nothing
    End If
    
  End If
  Set mo_HandObject = Nothing
  Exit Sub
ErrHandler:
  Call ErrorMessage("HideHandObject")
End Sub

Private Sub capdly_reportquit()
    Call HideHandObject
End Sub

'BEGIN T299.WP4
Private Sub Cap_RptView_Quit()
    Call HideHandObject
End Sub
'END T299.WP4

Private Sub ref_blob_quit()
  Call HideHandObject
End Sub

Private Sub reporting_quit()
    Call HideHandObject
End Sub
Private Sub hr_ctl_quit()
    Call HideHandObject
End Sub

Private Sub Capture_Unload()
    Call HideHandObject
End Sub

Private Sub refProject_Unload()
    Call HideHandObject
End Sub
Private Sub ref_blob_Unload()
    Call HideHandObject
End Sub

Private Sub samples_quit()
    Call HideHandObject
End Sub

Private Sub Capture_IsOfferLocked(ab_IsLocked As Boolean)
  If Not mo_Cap_OfferProd Is Nothing Then
    ab_IsLocked = (mo_Cap_OfferProd.DisplayMode = mt_CstValues.DisplayMode_Add) Or _
                  (mo_Cap_OfferProd.DisplayMode = mt_CstValues.DisplayMode_Update) Or _
                  (mo_Cap_OfferProd.DisplayMode = mt_CstValues.DisplayMode_Delete)
  End If
End Sub

Private Function Launch_CaptureArchive() As Boolean
    
    On Error GoTo onError
    
    MouseOff
    
    If mo_capArchive Is Nothing Then
        Set mo_capArchive = Me.Controls.Add("Project1.CapArchive", "mo_capArchive")
        Call mo_capArchive.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Set mo_capArchive.Db = aDb
        mo_capArchive.Language_Code = gut_LangLogin.Code
        mo_capArchive.U_Code = prg.U_Code
        mo_capArchive.LoginName = prg.LoginName  ' "SSAMSON" -- JN for debug
        
        If Not mo_capArchive.Load_A_COM Then
            MsgBox "Unable to launch capture Archive"
            Call mo_capArchive.Unload_A_COM
            GoTo onError
        End If
    End If
    mo_capArchive.Visible = True
    Set mo_HandObject = mo_capArchive
    MouseOn
    
    Launch_CaptureArchive = True
    Exit Function
    
onError:
    MouseOn
    If Not mo_capArchive Is Nothing Then Call Me.Controls.Remove("mo_capArchive")
    Set mo_capArchive = Nothing
     
    Launch_CaptureArchive = False
End Function

Private Function Launch_CaptureReporting() As Boolean
    
    On Error GoTo onError
    
    MouseOff
    
    If CapDly Is Nothing Then
        Set CapDly = Me.Controls.Add("Project1.Capdly", "capDly")
        Call CapDly.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Set CapDly.ArmDb = aDb
        CapDly.Language_Code = gut_LangLogin.Code
        CapDly.U_Code = prg.U_Code
        CapDly.capdly_user = prg.LoginName
        
        If Not CapDly.Load_A_COM Then
            MsgBox "Unable to launch capture reporting"
            Call CapDly.Unload_A_COM
            GoTo onError
        End If
            CapDly.Init_control
    End If
    CapDly.Visible = True
    Set mo_HandObject = CapDly
    MouseOn
    
    Launch_CaptureReporting = True
    Exit Function
    
onError:
    MouseOn
    If Not CapDly Is Nothing Then Call Me.Controls.Remove("capDly")
     Set CapDly = Nothing
    
    Launch_CaptureReporting = False
    
    
End Function

'BEGIN T299.WP4
Private Function Launch_CaptureRpt_View() As Boolean
    
    On Error GoTo onError
    
    MouseOff
    
    If Cap_RptView Is Nothing Then
        Set Cap_RptView = Me.Controls.Add("Project1.Cap_RptView", "Cap_RptView")
        Call Cap_RptView.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Set Cap_RptView.ArmDb = aDb
        Cap_RptView.LoginName = prg.LoginName
        Cap_RptView.Language_Code = "E" 'gut_LangLogin.Code
        Cap_RptView.U_Code = m_UCode
        If Not Cap_RptView.Load_A_COM Then
            MsgBox "Unable to launch capture online report view"
            Call Cap_RptView.Unload_A_COM
            GoTo onError
        End If
            Cap_RptView.Init_control
    End If
    Cap_RptView.Visible = True
    Set mo_HandObject = Cap_RptView
    MouseOn
    
    Launch_CaptureRpt_View = True
    Exit Function
    
onError:
    MouseOn
    If Not Cap_RptView Is Nothing Then Call Me.Controls.Remove("Cap_RptView")
    Set Cap_RptView = Nothing
    
    Launch_CaptureRpt_View = False
    
    
End Function
'BEGIN T299.WP4

Private Function Launch_TestManager() As Boolean
    On Error GoTo onError
    
    If TestManager Is Nothing Then
        Set TestManager = Me.Controls.Add("Project1.cpTstMan", "TestManager")
        TestManager.Visible = False
        Call TestManager.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        TestManager.Language_Code = gut_LangLogin.Code
        TestManager.LoginName = prg.LoginName
        Set TestManager.Db = aDb
        Set TestManager.DbErr = adb_err
        TestManager.U_Code = m_UCode
        
        If Not TestManager.Load_A_COM Then
            GoTo onError
        End If
        
    End If
    
    TestManager.Visible = True
    Set mo_HandObject = TestManager
    
    Launch_TestManager = True
    Exit Function

onError:
    MouseOn
    MsgBox "Unable to launch Test manager"
    If Not TestManager Then Call Me.Controls.Remove("TestManager")
     Set TestManager = Nothing
    Launch_TestManager = False

End Function

Private Sub TestManager_Unload()
    Call HideHandObject
End Sub


Private Function Launch_IVPO() As Boolean
    On Error GoTo onError
    
    Screen.MousePointer = vbHourglass
    
    If IvPO Is Nothing Then
        Set IvPO = Me.Controls.Add("Project1.ArmIVPO", "IVPO")
        IvPO.Visible = False
        Call IvPO.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        'ONLY IN FRENCH FOR THE MOMENT
        IvPO.Language_Code = "F"
        'IvPO.Language_Code = gut_LangLogin.Code
        
        Set IvPO.Db = aDb
        IvPO.LoginName = prg.LoginName
        IvPO.TempPath = App.Path & REP_DOWNLOAD
        
        If Not IvPO.Load_A_COM Then
            Call IvPO.Unload_A_COM
            GoTo onError
        End If
    
    End If
    IvPO.Visible = True
    Set mo_HandObject = IvPO
    Screen.MousePointer = 0
    Exit Function
onError:
Screen.MousePointer = 0
    MsgBox "Unable to launch Ivry Purchase Order"
     If Not IvPO Is Nothing Then Call Me.Controls.Remove("IVPO")
     Set IvPO = Nothing
    Screen.MousePointer = 0
    Exit Function
End Function
  
Private Function Launch_SRM() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_SRM Is Nothing Then
        Set mo_SRM = Me.Controls.Add("Project1.SRM_Navig", "SRM")
        
        mo_SRM.Visible = False
        Set mo_SRM.Db = aDb
        mo_SRM.Language_Code = gut_LangLogin.Code
        mo_SRM.U_Code = prg.U_Code
        mo_SRM.LoginName = prg.LoginName
        
        Call mo_SRM.Load_A_COM
        If Not mo_SRM.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("SRM")
            Call mo_SRM.Unload_A_COM
            Set mo_SRM = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_SRM.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_SRM.Visible = True
    Set mo_HandObject = mo_SRM
    Launch_SRM = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_SRM = False
    MsgBox "Unable to launch SRM application"
    If Not mo_SRM Is Nothing Then Call Me.Controls.Remove("SRM")
    Set mo_SRM = Nothing
End Function


Private Function Launch_MetalSalesAnalysis() As Boolean

    On Error GoTo onError
    
    MouseOff
    
    If Not HaveRight("MSA") Then
        MouseOn
        Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
        Exit Function
    End If

    
    If (mo_MetalSalesAnalysis Is Nothing) Then
        Set mo_MetalSalesAnalysis = Me.Controls.Add("Project1.MetalSalesAnalysis", "MSA")
        mo_MetalSalesAnalysis.Visible = False
        Set mo_MetalSalesAnalysis.Db = aDb
        mo_MetalSalesAnalysis.Language_Code = gut_LangLogin.Code
        mo_MetalSalesAnalysis.U_Code = prg.U_Code
        mo_MetalSalesAnalysis.LoginName = prg.LoginName
        
        Call mo_MetalSalesAnalysis.Load_A_COM
        
    End If
    Call mo_MetalSalesAnalysis.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    mo_MetalSalesAnalysis.Visible = True
    Set mo_HandObject = mo_MetalSalesAnalysis
    Launch_MetalSalesAnalysis = True
    
    MouseOn
    Exit Function

    MouseOn
    Exit Function

onError:
    MouseOn
    Launch_MetalSalesAnalysis = False
    MsgBox "Unable to Launch Metal Sales Analysis application : " & Err.Description
    If Not mo_MetalSalesAnalysis Is Nothing Then Call Me.Controls.Remove("MSA")
    Set mo_MetalSalesAnalysis = Nothing
End Function


Private Function Launch_Reporting() As Boolean

On Error GoTo onError
    MouseOff
    
    If reporting Is Nothing Then
        Set reporting = Me.Controls.Add("Project1.ArmReporting", "Reporting")
        Call reporting.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        
        If Not reporting.Load_A_COM Then
            Call reporting.Unload_A_COM
            GoTo onError
        End If
        
        reporting.UserID = prg.LoginName
        reporting.Language = gut_LangLogin.Code
        Set reporting.ArmDb = aDb
        Call reporting.Init
    End If

    reporting.Visible = True
    Set mo_HandObject = reporting

    Launch_Reporting = True
    MouseOn
    Exit Function


onError:
    MouseOn
    MsgBox "Unable to launch Reporting Tools"
    If Not reporting Is Nothing Then Call Me.Controls.Remove("Reporting")
     Set reporting = Nothing
    Launch_Reporting = False

End Function

Private Function Launch_UserControl(ByVal as_userControl As String, ByVal as_ucName As String) As Control

On Error GoTo onError
    MouseOff
    
    Dim lo_retControl As Control, ll_Index As Long
    For ll_Index = 0 To Me.Controls.Count - 1
        If Me.Controls(ll_Index).Name = as_ucName Then
            Set lo_retControl = Me.Controls(ll_Index)
            Exit For
        End If
    Next
    
    If lo_retControl Is Nothing Then
        Set lo_retControl = Me.Controls.Add(as_userControl, as_ucName)
        
        lo_retControl.U_Code = prg.U_Code
        lo_retControl.LoginName = prg.LoginName
        lo_retControl.Language_Code = gut_LangLogin.Code
        Set lo_retControl.Db = aDb
        Call lo_retControl.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call lo_retControl.Load_A_COM
    End If

    lo_retControl.Visible = True
    Set mo_HandObject = lo_retControl

    MouseOn
    Set Launch_UserControl = lo_retControl
    Exit Function

onError:
    MouseOn
    If Not lo_retControl Is Nothing Then
        Call Me.Controls.Remove(as_ucName)
    End If
    Set Launch_UserControl = Nothing
End Function

Private Function Launch_CompDB() As Boolean

On Error GoTo onError
    MouseOff
    
    If CompetitiveDB Is Nothing Then
        Set CompetitiveDB = Me.Controls.Add("Project1.Comp_DB", "CompDB")
        Call CompetitiveDB.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        
        Set CompetitiveDB.Db = aDb
        CompetitiveDB.LoginName = prg.LoginName
        CompetitiveDB.Ucode = prg.U_Code
        CompetitiveDB.Language_Code = gut_LangLogin.Code
        
        If Not CompetitiveDB.Load_A_COM Then
            Call CompetitiveDB.Unload_A_COM
            GoTo onError
        End If
       
    End If

    CompetitiveDB.Visible = True
    Set mo_HandObject = CompetitiveDB

    Launch_CompDB = True
    MouseOn
    Exit Function

onError:
    MouseOn
    MsgBox "Unable to launch Competitive database"
    If Not CompetitiveDB Is Nothing Then Call Me.Controls.Remove("CompDB")
     Set CompetitiveDB = Nothing
    Launch_CompDB = False
    
End Function

Private Function Launch_TSMItemChecker() As Boolean

On Error GoTo onError
    MouseOff
    
    If TSMItemChecker Is Nothing Then
        Set TSMItemChecker = Me.Controls.Add("Project1.TSMRptItm", "TSMRpI")
        Call TSMItemChecker.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)

        Set TSMItemChecker.Db = aDb
        TSMItemChecker.LoginName = prg.LoginName
        TSMItemChecker.Ucode = prg.U_Code
        TSMItemChecker.Language_Code = gut_LangLogin.Code
        
        If Not TSMItemChecker.Load_A_COM Then
            Call TSMItemChecker.Unload_A_COM
            GoTo onError
        End If
       
    End If

    TSMItemChecker.Visible = True
    Set mo_HandObject = TSMItemChecker

    Launch_TSMItemChecker = True
    MouseOn
    Exit Function

onError:
    MouseOn
    MsgBox "Unable to launch the Item Checker"
    If Not TSMItemChecker Is Nothing Then Call Me.Controls.Remove("TSMRpI")
     Set TSMItemChecker = Nothing
    Launch_TSMItemChecker = False
    
End Function


Private Function Launch_GEMASOM() As Boolean
    On Error GoTo onError
    
    MouseOff
    If GEMASOM Is Nothing Then
        
        If Not SOM_lib.Rights_Access(aDb, prg.U_Code) Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
    
        Set GEMASOM = Me.Controls.Add("Project1.SOM_Navig", "GEMASOM")
        Call GEMASOM.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        GEMASOM.Ucode = prg.U_Code
        GEMASOM.LoginName = prg.LoginName
        GEMASOM.FullUserName = prg.FullName
        GEMASOM.Language_Code = gut_LangLogin.Code
        
        
        Set GEMASOM.Db = aDb
        Call GEMASOM.Load_A_COM
    End If
    Set mo_HandObject = GEMASOM
    GEMASOM.A_Visible = True
    MouseOn
    Exit Function
onError:
    MouseOn
    MsgBox "Unable to launch GEMA SOM"
    If Not GEMASOM Is Nothing Then Call Me.Controls.Remove("GEMASOM")
     Set GEMASOM = Nothing
    Launch_GEMASOM = False
    
   
End Function



Private Function Launch_GEMARATE() As Boolean
    On Error GoTo onError
    
    MouseOff
    If GEMARate Is Nothing Then
        Set GEMARate = Me.Controls.Add("Project1.SOM_ExchRate", "GEMARate")
        Call GEMARate.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        GEMARate.Ucode = prg.U_Code
        GEMARate.LoginName = prg.LoginName
        GEMARate.FullUserName = prg.LoginName
        GEMARate.Language_Code = gut_LangLogin.Code
        
        Set GEMARate.Db = aDb
        If Not GEMARate.Load_A_COM Then
            Me.Controls.Remove ("GEMARate")
            Set GEMARate = Nothing
        End If
    End If
    Set mo_HandObject = GEMARate
    If Not GEMARate Is Nothing Then
        GEMARate.A_Visible = True
    End If
    MouseOn
    Exit Function
    
onError:
    MouseOn
    MsgBox "Unable to launch GEMA SOM"
    If Not GEMASOM Is Nothing Then Call Me.Controls.Remove("GEMARate")
     Set GEMASOM = Nothing
    Launch_GEMARATE = False
    
   
End Function



Private Function Launch_CompDBRights() As Boolean

On Error GoTo onError
    MouseOff
    
    If CDRights Is Nothing Then
    
        ' Check rights
        If Not HaveRight("MKTDBRIGHT") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
    
        Set CDRights = Me.Controls.Add("Project1.MKTRightsAdmin", "CompDBRight")
        Call CDRights.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        
        Set CDRights.Db = aDb
        'CDRights.LoginName = prg.LoginName
        CDRights.U_Code = prg.U_Code
        CDRights.Language_Code = gut_LangLogin.Code
        
        Call CDRights.Load_A_COM
    End If

    CDRights.Visible = True
    Set mo_HandObject = CDRights

    Launch_CompDBRights = True
    MouseOn
    Exit Function

onError:
    MouseOn
    MsgBox "Unable to launch Competitive database"
    If Not CDRights Is Nothing Then Call Me.Controls.Remove("CompDBRight")
     Set CDRights = Nothing
    Launch_CompDBRights = False
    
End Function

Private Function Launch_TimeMgmt() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_TimeMgmt Is Nothing Then
        Set mo_TimeMgmt = Me.Controls.Add("Project1.TimeMgmt", "TimeMgmt")
        
        mo_TimeMgmt.Visible = False
        Set mo_TimeMgmt.ArmDb = aDb
        mo_TimeMgmt.Language_Code = gut_LangLogin.Code
        mo_TimeMgmt.U_Code = prg.U_Code
        mo_TimeMgmt.LoginName = prg.LoginName
        
        Call mo_TimeMgmt.Load_A_COM
        If Not mo_TimeMgmt.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("TimeMgmt")
            Call mo_TimeMgmt.Unload_A_COM
            Set mo_TimeMgmt = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_TimeMgmt.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_TimeMgmt.Resize
    End If
    mo_TimeMgmt.Visible = True
    Set mo_HandObject = mo_TimeMgmt
    Launch_TimeMgmt = True
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_TimeMgmt = False
    MsgBox "Unable to launch Time management application: " & Err.Description
    If Not mo_TimeMgmt Is Nothing Then Call Me.Controls.Remove("TimeMgmt")
    Set mo_TimeMgmt = Nothing
End Function

Private Function Launch_EAS_Client() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_EAS_Client Is Nothing Then
        Set mo_EAS_Client = Me.Controls.Add("Project1.EAS_Client", "EAS_Client")
        
        mo_EAS_Client.Visible = False
        Set mo_EAS_Client.ArmDb = aDb
        mo_EAS_Client.Language_Code = gut_LangLogin.Code
        mo_EAS_Client.U_Code = prg.U_Code
        mo_EAS_Client.LoginName = prg.LoginName
        
        Call mo_EAS_Client.Load_A_COM
        If Not mo_EAS_Client.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("EAS_Client")
            Call mo_EAS_Client.Unload_A_COM
            Set mo_EAS_Client = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_EAS_Client.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_EAS_Client.Resize
    End If
    mo_EAS_Client.Visible = True
    Set mo_HandObject = mo_EAS_Client
    Launch_EAS_Client = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_EAS_Client = False
    MsgBox "Unable to launch EAS Client application: " & Err.Description
    If Not mo_EAS_Client Is Nothing Then Call Me.Controls.Remove("EAS_Client")
    Set mo_EAS_Client = Nothing
End Function

Private Function Launch_EAS_Viewer() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_EAS_Viewer Is Nothing Then
        Set mo_EAS_Viewer = Me.Controls.Add("Project1.EAS_Viewer", "EAS_Viewer")
        
        mo_EAS_Viewer.Visible = False
        Set mo_EAS_Viewer.ArmDb = aDb
        mo_EAS_Viewer.Language_Code = gut_LangLogin.Code
        mo_EAS_Viewer.U_Code = prg.U_Code
        mo_EAS_Viewer.LoginName = prg.LoginName
        
        Call mo_EAS_Viewer.Load_A_COM
        Call mo_EAS_Viewer.Init_control
        If Not mo_EAS_Viewer.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("EAS_Viewer")
            Call mo_EAS_Viewer.Unload_A_COM
            Set mo_EAS_Viewer = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_EAS_Viewer.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_EAS_Viewer.Resize
    End If
    mo_EAS_Viewer.Visible = True
    Set mo_HandObject = mo_EAS_Viewer
    Launch_EAS_Viewer = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_EAS_Viewer = False
    MsgBox "Unable to launch EAS Viewer application: " & Err.Description
    If Not mo_EAS_Viewer Is Nothing Then Call Me.Controls.Remove("EAS_Viewer")
    Set mo_EAS_Viewer = Nothing
End Function

Private Function Launch_CapActivity() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_capActivity Is Nothing Then
        Set mo_capActivity = Me.Controls.Add("Project1.CapActivity", "CapActivity")
        
        mo_capActivity.Visible = False
        Set mo_capActivity.ArmDb = aDb
        mo_capActivity.Language_Code = gut_LangLogin.Code
        mo_capActivity.U_Code = prg.U_Code
        mo_capActivity.LoginName = prg.LoginName
        
        Call mo_capActivity.Load_A_COM
        If Not mo_capActivity.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("CapActivity")
            Call mo_capActivity.Unload_A_COM
            Set mo_capActivity = Nothing
            MouseOn
            Exit Function
        End If
        If Not mo_capActivity.Init_control Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 666, "Module not yet available. Still in progress.")
            Call Me.Controls.Remove("CapActivity")
            Call mo_capActivity.Unload_A_COM
            Set mo_capActivity = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_capActivity.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_capActivity.Visible = True
    Set mo_HandObject = mo_capActivity
    Launch_CapActivity = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_CapActivity = False
    MsgBox "Unable to launch Capture Activity application: " & Err.Description
    If Not mo_capActivity Is Nothing Then Call Me.Controls.Remove("CapActivity")
    Set mo_capActivity = Nothing
End Function

Private Function Launch_MetalCompare() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_metalCompare Is Nothing Then
        Set mo_metalCompare = Me.Controls.Add("Project1.MetalCompare", "MetalCompare")
        
        mo_metalCompare.Visible = False
        Set mo_metalCompare.ArmDb = aDb
        mo_metalCompare.Language_Code = gut_LangLogin.Code
        mo_metalCompare.U_Code = prg.U_Code
        mo_metalCompare.LoginName = prg.LoginName
        
        Call mo_metalCompare.Load_A_COM
        If Not mo_metalCompare.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("MetalCompare")
            Call mo_metalCompare.Unload_A_COM
            Set mo_metalCompare = Nothing
            MouseOn
            Exit Function
        End If
        If Not mo_metalCompare.Init_control Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 666, "Module not yet available. Still in progress.")
            Call Me.Controls.Remove("MetalCompare")
            Call mo_metalCompare.Unload_A_COM
            Set mo_metalCompare = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_metalCompare.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_metalCompare.Visible = True
    Set mo_HandObject = mo_metalCompare
    Launch_MetalCompare = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_MetalCompare = False
    MsgBox "Unable to launch SAP - Sifyb Metal Compare application: " & Err.Description
    If Not mo_metalCompare Is Nothing Then Call Me.Controls.Remove("MetalCompare")
    Set mo_metalCompare = Nothing
End Function
Private Function Launch_Cap_OfferProd() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_Cap_OfferProd Is Nothing Then
        Set mo_Cap_OfferProd = Me.Controls.Add("Project1.Cap_OfferProd", "Cap_OfferProd")
        
        mo_Cap_OfferProd.Visible = False
        Set mo_Cap_OfferProd.ArmDb = aDb
        Set mo_Cap_OfferProd.Tools = mo_Tools
        Set mo_Cap_OfferProd.CstValues = mt_CstValues
        mo_Cap_OfferProd.Language_Code = gut_LangLogin.Code
        mo_Cap_OfferProd.U_Code = prg.U_Code
        mo_Cap_OfferProd.LoginName = prg.LoginName
        Call mo_Cap_OfferProd.Load_A_COM
        If Not mo_Cap_OfferProd.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("Cap_OfferProd")
            Call mo_Cap_OfferProd.Unload_A_COM
            Set mo_Cap_OfferProd = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_Cap_OfferProd.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_Cap_OfferProd.Resize
    End If
    mo_Cap_OfferProd.Visible = True
    Set mo_HandObject = mo_Cap_OfferProd
    Launch_Cap_OfferProd = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_Cap_OfferProd = False
    MsgBox "Unable to launch Cap_OfferProd application: " & Err.Description
    If Not mo_Cap_OfferProd Is Nothing Then Call Me.Controls.Remove("Cap_OfferProd")
    Set mo_Cap_OfferProd = Nothing
End Function

Private Function Launch_Cap_OfferTemp() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_Cap_OfferTemp Is Nothing Then
        Set mo_Cap_OfferTemp = Me.Controls.Add("Project1.Cap_OfferTemp", "Cap_OfferTemp")
        
        mo_Cap_OfferTemp.Visible = False
        Set mo_Cap_OfferTemp.ArmDb = aDb
        Set mo_Cap_OfferTemp.Tools = mo_Tools
        mo_Cap_OfferTemp.Language_Code = gut_LangLogin.Code
        mo_Cap_OfferTemp.U_Code = prg.U_Code
        mo_Cap_OfferTemp.LoginName = prg.LoginName
        
        Call mo_Cap_OfferTemp.Load_A_COM
        If Not mo_Cap_OfferTemp.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("Cap_OfferTemp")
            Call mo_Cap_OfferTemp.Unload_A_COM
            Set mo_Cap_OfferTemp = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_Cap_OfferTemp.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_Cap_OfferTemp.Resize
    End If
    mo_Cap_OfferTemp.Visible = True
    Set mo_HandObject = mo_Cap_OfferTemp
    Launch_Cap_OfferTemp = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_Cap_OfferTemp = False
    MsgBox "Unable to launch Cap_OfferTemp application: " & Err.Description
    If Not mo_Cap_OfferTemp Is Nothing Then Call Me.Controls.Remove("Cap_OfferTemp")
    Set mo_Cap_OfferTemp = Nothing
End Function

Private Function Launch_DPC_Ref() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DPC_Ref Is Nothing Then
        Set mo_DPC_Ref = Me.Controls.Add("Project1.DPC_Ref", "DPC_Ref")
        
        mo_DPC_Ref.Visible = False
        Set mo_DPC_Ref.ArmDb = aDb
        Set mo_DPC_Ref.Tools = mo_Tools
        mo_DPC_Ref.Language_Code = gut_LangLogin.Code
        mo_DPC_Ref.U_Code = prg.U_Code
        mo_DPC_Ref.LoginName = prg.LoginName
        
        Call mo_DPC_Ref.Load_A_COM
        Call mo_DPC_Ref.Init_control
        If Not mo_DPC_Ref.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DPC_Ref")
            Call mo_DPC_Ref.Unload_A_COM
            Set mo_DPC_Ref = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DPC_Ref.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DPC_Ref.Resize
    End If
    mo_DPC_Ref.Visible = True
    Set mo_HandObject = mo_DPC_Ref
    Launch_DPC_Ref = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DPC_Ref = False
    MsgBox "Unable to launch DPC_Ref application: " & Err.Description
    If Not mo_DPC_Ref Is Nothing Then Call Me.Controls.Remove("DPC_Ref")
    Set mo_DPC_Ref = Nothing
End Function

Private Function Launch_DPC_Ref_2() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DPC_Ref_2 Is Nothing Then
        Set mo_DPC_Ref_2 = Me.Controls.Add("Project1.DPC_Ref_2", "DPC_Ref_2")
        
        mo_DPC_Ref_2.Visible = False
        Set mo_DPC_Ref_2.ArmDb = aDb
        Set mo_DPC_Ref_2.Tools = mo_Tools
        mo_DPC_Ref_2.Language_Code = gut_LangLogin.Code
        mo_DPC_Ref_2.U_Code = prg.U_Code
        mo_DPC_Ref_2.LoginName = prg.LoginName
        
        Call mo_DPC_Ref_2.Load_A_COM
        Call mo_DPC_Ref_2.Init_control
        If Not mo_DPC_Ref_2.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DPC_Ref_2")
            Call mo_DPC_Ref_2.Unload_A_COM
            Set mo_DPC_Ref_2 = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DPC_Ref_2.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DPC_Ref_2.Resize
    End If
    mo_DPC_Ref_2.Visible = True
    Set mo_HandObject = mo_DPC_Ref_2
    Launch_DPC_Ref_2 = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DPC_Ref_2 = False
    MsgBox "Unable to launch DPC_Ref_2 application: " & Err.Description
    If Not mo_DPC_Ref_2 Is Nothing Then Call Me.Controls.Remove("DPC_Ref_2")
    Set mo_DPC_Ref_2 = Nothing
End Function

Private Function Launch_DPC_Ref_Sys() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DPC_Ref_Sys Is Nothing Then
        Set mo_DPC_Ref_Sys = Me.Controls.Add("Project1.DPC_Ref_Sys", "DPC_Ref_Sys")
        
        mo_DPC_Ref_Sys.Visible = False
        Set mo_DPC_Ref_Sys.ArmDb = aDb
        Set mo_DPC_Ref_Sys.Tools = mo_Tools
        mo_DPC_Ref_Sys.Language_Code = gut_LangLogin.Code
        mo_DPC_Ref_Sys.U_Code = prg.U_Code
        mo_DPC_Ref_Sys.LoginName = prg.LoginName
        
        Call mo_DPC_Ref_Sys.Load_A_COM
        Call mo_DPC_Ref_Sys.Init_control
        If Not mo_DPC_Ref_Sys.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DPC_Ref_Sys")
            Call mo_DPC_Ref_Sys.Unload_A_COM
            Set mo_DPC_Ref_Sys = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DPC_Ref_Sys.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DPC_Ref_Sys.Resize
    End If
    mo_DPC_Ref_Sys.Visible = True
    Set mo_HandObject = mo_DPC_Ref_Sys
    Launch_DPC_Ref_Sys = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DPC_Ref_Sys = False
    MsgBox "Unable to launch DPC_Ref_Sys application: " & Err.Description
    If Not mo_DPC_Ref_Sys Is Nothing Then Call Me.Controls.Remove("DPC_Ref_Sys")
    Set mo_DPC_Ref_Sys = Nothing
End Function

Private Function Launch_DPC_Ref_Bor() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DPC_Ref_Bor Is Nothing Then
        Set mo_DPC_Ref_Bor = Me.Controls.Add("Project1.DPC_Ref_Bor", "DPC_Ref_Bor")
        
        mo_DPC_Ref_Bor.Visible = False
        Set mo_DPC_Ref_Bor.ArmDb = aDb
        Set mo_DPC_Ref_Bor.Tools = mo_Tools
        mo_DPC_Ref_Bor.Language_Code = gut_LangLogin.Code
        mo_DPC_Ref_Bor.U_Code = prg.U_Code
        mo_DPC_Ref_Bor.LoginName = prg.LoginName
        
        Call mo_DPC_Ref_Bor.Load_A_COM
        Call mo_DPC_Ref_Bor.Init_control
        If Not mo_DPC_Ref_Bor.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DPC_Ref_Bor")
            Call mo_DPC_Ref_Bor.Unload_A_COM
            Set mo_DPC_Ref_Bor = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DPC_Ref_Bor.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DPC_Ref_Bor.Resize
    End If
    mo_DPC_Ref_Bor.Visible = True
    Set mo_HandObject = mo_DPC_Ref_Bor
    Launch_DPC_Ref_Bor = True
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DPC_Ref_Bor = False
    MsgBox "Unable to launch DPC_Ref_Bor application: " & Err.Description
    If Not mo_DPC_Ref_Bor Is Nothing Then Call Me.Controls.Remove("DPC_Ref_Bor")
    Set mo_DPC_Ref_Bor = Nothing
End Function

Private Function Launch_DPC_Ref_Bom() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DPC_Ref_Bom Is Nothing Then
        Set mo_DPC_Ref_Bom = Me.Controls.Add("Project1.DPC_Ref_Bom", "DPC_Ref_Bom")
        
        mo_DPC_Ref_Bom.Visible = False
        Set mo_DPC_Ref_Bom.ArmDb = aDb
        Set mo_DPC_Ref_Bom.Tools = mo_Tools
        mo_DPC_Ref_Bom.Language_Code = gut_LangLogin.Code
        mo_DPC_Ref_Bom.U_Code = prg.U_Code
        mo_DPC_Ref_Bom.LoginName = prg.LoginName
        
        Call mo_DPC_Ref_Bom.Load_A_COM
        Call mo_DPC_Ref_Bom.Init_control
        If Not mo_DPC_Ref_Bom.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DPC_Ref_Bom")
            Call mo_DPC_Ref_Bom.Unload_A_COM
            Set mo_DPC_Ref_Bom = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DPC_Ref_Bom.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DPC_Ref_Bom.Resize
    End If
    mo_DPC_Ref_Bom.Visible = True
    Set mo_HandObject = mo_DPC_Ref_Bom
    Launch_DPC_Ref_Bom = True
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DPC_Ref_Bom = False
    MsgBox "Unable to launch DPC_Ref_Bom application: " & Err.Description
    If Not mo_DPC_Ref_Bom Is Nothing Then Call Me.Controls.Remove("DPC_Ref_Bom")
    Set mo_DPC_Ref_Bom = Nothing
End Function

Private Function Launch_DPC_Ref_Sub() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DPC_Ref_Sub Is Nothing Then
        Set mo_DPC_Ref_Sub = Me.Controls.Add("Project1.DPC_Ref_Sub", "DPC_Ref_Sub")
        
        mo_DPC_Ref_Sub.Visible = False
        Set mo_DPC_Ref_Sub.ArmDb = aDb
        Set mo_DPC_Ref_Sub.Tools = mo_Tools
        mo_DPC_Ref_Sub.Language_Code = gut_LangLogin.Code
        mo_DPC_Ref_Sub.U_Code = prg.U_Code
        mo_DPC_Ref_Sub.LoginName = prg.LoginName
        
        Call mo_DPC_Ref_Sub.Load_A_COM
        Call mo_DPC_Ref_Sub.Init_control
        If Not mo_DPC_Ref_Sub.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DPC_Ref_Sub")
            Call mo_DPC_Ref_Sub.Unload_A_COM
            Set mo_DPC_Ref_Sub = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DPC_Ref_Sub.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DPC_Ref_Sub.Resize
    End If
    mo_DPC_Ref_Sub.Visible = True
    Set mo_HandObject = mo_DPC_Ref_Sub
    Launch_DPC_Ref_Sub = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DPC_Ref_Sub = False
    MsgBox "Unable to launch DPC_Ref_Sub application: " & Err.Description
    If Not mo_DPC_Ref_Sub Is Nothing Then Call Me.Controls.Remove("DPC_Ref_Sub")
    Set mo_DPC_Ref_Sub = Nothing
End Function

Private Function Launch_DPC_Ref_Prices() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DPC_Ref_Prices Is Nothing Then
        Set mo_DPC_Ref_Prices = Me.Controls.Add("Project1.DPC_Ref_Prices", "DPC_Ref_Prices")
        
        mo_DPC_Ref_Prices.Visible = False
        Set mo_DPC_Ref_Prices.ArmDb = aDb
        Set mo_DPC_Ref_Prices.Tools = mo_Tools
        mo_DPC_Ref_Prices.Language_Code = gut_LangLogin.Code
        mo_DPC_Ref_Prices.U_Code = prg.U_Code
        mo_DPC_Ref_Prices.LoginName = prg.LoginName
        
        Call mo_DPC_Ref_Prices.Load_A_COM
        Call mo_DPC_Ref_Prices.Init_control
        If Not mo_DPC_Ref_Prices.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DPC_Ref_Prices")
            Call mo_DPC_Ref_Prices.Unload_A_COM
            Set mo_DPC_Ref_Prices = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DPC_Ref_Prices.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DPC_Ref_Prices.Resize
    End If
    mo_DPC_Ref_Prices.Visible = True
    Set mo_HandObject = mo_DPC_Ref_Prices
    Launch_DPC_Ref_Prices = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DPC_Ref_Prices = False
    MsgBox "Unable to launch DPC_Ref_Prices application: " & Err.Description
    If Not mo_DPC_Ref_Prices Is Nothing Then Call Me.Controls.Remove("DPC_Ref_Prices")
    Set mo_DPC_Ref_Prices = Nothing
End Function



Private Function Launch_ONSV_GSV() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_ONSV_GSV Is Nothing Then
    
        If Not HaveRight("ONSVMNGUSER") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
        
        Set mo_ONSV_GSV = Me.Controls.Add("Project1.ONSV_GSVManager", "ONSV_Gsv")
        
        mo_ONSV_GSV.Visible = False
        Set mo_ONSV_GSV.ArmDb = aDb
        mo_ONSV_GSV.Language_Code = gut_LangLogin.Code
        mo_ONSV_GSV.U_Code = prg.U_Code
        
        Call mo_ONSV_GSV.Load_A_COM
        If Not mo_ONSV_GSV.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("ONSV_Gsv")
            Call mo_ONSV_GSV.Unload_A_COM
            Set mo_ONSV_GSV = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_ONSV_GSV.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_ONSV_GSV.Visible = True
    Set mo_HandObject = mo_ONSV_GSV
    Launch_ONSV_GSV = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_ONSV_GSV = False
    MsgBox "Unable to launch ONSV_Gsv application: " & Err.Description
    If Not mo_ONSV_GSV Is Nothing Then Call Me.Controls.Remove("ONSV_Gsv")
    Set mo_ONSV_GSV = Nothing
End Function


Private Function Launch_ONSV_BMK() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_ONSV_BMK Is Nothing Then
    
        If Not HaveRight("ONSVMNGUSER") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
        
        Set mo_ONSV_BMK = Me.Controls.Add("Project1.ONSV_BMKManager", "ONSV_Bmk")
        
        mo_ONSV_BMK.Visible = False
        Set mo_ONSV_BMK.ArmDb = aDb
        mo_ONSV_BMK.Language_Code = gut_LangLogin.Code
        mo_ONSV_BMK.U_Code = prg.U_Code
        
        Call mo_ONSV_BMK.Load_A_COM
        If Not mo_ONSV_BMK.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("ONSV_Bmk")
            Call mo_ONSV_BMK.Unload_A_COM
            Set mo_ONSV_BMK = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_ONSV_BMK.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_ONSV_BMK.Visible = True
    Set mo_HandObject = mo_ONSV_BMK
    Launch_ONSV_BMK = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    mo_ONSV_BMK = False
    MsgBox "Unable to launch ONSV_Bmk application: " & Err.Description
    If Not mo_ONSV_BMK Is Nothing Then Call Me.Controls.Remove("ONSV_Bmk")
    Set mo_ONSV_BMK = Nothing
End Function


Private Function Launch_ONSV_MG() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_ONSV_MG Is Nothing Then
    
        If Not HaveRight("ONSVMNGUSER") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
        
        Set mo_ONSV_MG = Me.Controls.Add("Project1.ONSV_MGManager", "ONSV_Mg")
        
        mo_ONSV_MG.Visible = False
        Set mo_ONSV_MG.ArmDb = aDb
        mo_ONSV_MG.Language_Code = gut_LangLogin.Code
        mo_ONSV_MG.U_Code = prg.U_Code
        
        Call mo_ONSV_MG.Load_A_COM
        If Not mo_ONSV_MG.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("ONSV_Mg")
            Call mo_ONSV_MG.Unload_A_COM
            Set mo_ONSV_MG = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_ONSV_MG.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_ONSV_MG.Visible = True
    Set mo_HandObject = mo_ONSV_MG
    Launch_ONSV_MG = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_ONSV_MG = False
    MsgBox "Unable to launch ONSV_Mg application: " & Err.Description
    If Not mo_ONSV_MG Is Nothing Then Call Me.Controls.Remove("ONSV_Mg")
    Set mo_ONSV_MG = Nothing
End Function

Private Function Launch_DPC_Ref_PDFGenerator() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DPC_Ref_PDFGenerator Is Nothing Then
        Set mo_DPC_Ref_PDFGenerator = Me.Controls.Add("Project1.DPC_Ref_PDFGenerator", "DPC_Ref_PDFGenerator")
        
        mo_DPC_Ref_PDFGenerator.Visible = False
        Set mo_DPC_Ref_PDFGenerator.ArmDb = aDb
        Set mo_DPC_Ref_PDFGenerator.Tools = mo_Tools
        mo_DPC_Ref_PDFGenerator.Language_Code = gut_LangLogin.Code
        mo_DPC_Ref_PDFGenerator.U_Code = prg.U_Code
        mo_DPC_Ref_PDFGenerator.LoginName = prg.LoginName
        
        Call mo_DPC_Ref_PDFGenerator.Load_A_COM
        Call mo_DPC_Ref_PDFGenerator.Init_control
        If Not mo_DPC_Ref_PDFGenerator.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DPC_Ref_PDFGenerator")
            Call mo_DPC_Ref_PDFGenerator.Unload_A_COM
            Set mo_DPC_Ref_PDFGenerator = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DPC_Ref_PDFGenerator.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DPC_Ref_PDFGenerator.Resize
    End If
    mo_DPC_Ref_PDFGenerator.Visible = True
    Set mo_HandObject = mo_DPC_Ref_PDFGenerator
    Launch_DPC_Ref_PDFGenerator = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DPC_Ref_PDFGenerator = False
    MsgBox "Unable to launch DPC_Ref_PDFGenerator application: " & Err.Description
    If Not mo_DPC_Ref_PDFGenerator Is Nothing Then Call Me.Controls.Remove("DPC_Ref_PDFGenerator")
    Set mo_DPC_Ref_PDFGenerator = Nothing
End Function

Private Function Launch_ONSV_BDG() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_ONSV_Bdg Is Nothing Then
    
        If Not HaveRight("ONSVMNGUSER") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
        
        Set mo_ONSV_Bdg = Me.Controls.Add("Project1.ONSV_baselines", "ONSV_Bdg")
        
        mo_ONSV_Bdg.Visible = False
        Set mo_ONSV_Bdg.ArmDb = aDb
        mo_ONSV_Bdg.Language_Code = gut_LangLogin.Code
        mo_ONSV_Bdg.U_Code = prg.U_Code
        
        Call mo_ONSV_Bdg.Load_A_COM
        If Not mo_ONSV_Bdg.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("ONSV_Bdg")
            Call mo_ONSV_Bdg.Unload_A_COM
            Set mo_ONSV_Bdg = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_ONSV_Bdg.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_ONSV_Bdg.Visible = True
    Set mo_HandObject = mo_ONSV_Bdg
    Launch_ONSV_BDG = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_ONSV_BDG = False
    MsgBox "Unable to launch ONSV_Bdg application: " & Err.Description
    If Not mo_ONSV_Bdg Is Nothing Then Call Me.Controls.Remove("ONSV_Bdg")
    Set mo_ONSV_Bdg = Nothing
End Function


Private Function Launch_ONSV_REPORT() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_ONSV_Rpt Is Nothing Then
    
        If Not HaveRight("ONSVRPTUSER") Then
            MouseOn
            MsgBox "You are not allowed to access to this application"
            Exit Function
        End If
        
        Set mo_ONSV_Rpt = Me.Controls.Add("Project1.ONSV_Report", "ONSV_Report")
        
        mo_ONSV_Rpt.Visible = False
        Set mo_ONSV_Rpt.ArmDb = aDb
        mo_ONSV_Rpt.Language_Code = gut_LangLogin.Code
        mo_ONSV_Rpt.U_Code = prg.U_Code
        mo_ONSV_Rpt.LoginName = prg.LoginName
        
        Call mo_ONSV_Rpt.Load_A_COM
        If Not mo_ONSV_Rpt.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("ONSV_Report")
            Call mo_ONSV_Rpt.Unload_A_COM
            Set mo_ONSV_Rpt = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_ONSV_Rpt.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_ONSV_Rpt.Visible = True
    Set mo_HandObject = mo_ONSV_Rpt
    Launch_ONSV_REPORT = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_ONSV_REPORT = False
    MsgBox "Unable to launch ONSV_Report application: " & Err.Description
    If Not mo_ONSV_Rpt Is Nothing Then Call Me.Controls.Remove("ONSV_Report")
    Set mo_ONSV_Rpt = Nothing
End Function

Private Function Launch_DC_Invoice() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DC_Invoice Is Nothing Then
    
        Set mo_DC_Invoice = Me.Controls.Add("Project1.DC_InvoiceMtnc", "DC_Invoice")
        
        mo_DC_Invoice.Visible = False
        Set mo_DC_Invoice.ArmDb = aDb
        mo_DC_Invoice.Language_Code = gut_LangLogin.Code
        mo_DC_Invoice.U_Code = prg.U_Code
        mo_DC_Invoice.LoginName = prg.LoginName
        
        Call mo_DC_Invoice.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
        Call mo_DC_Invoice.Load_A_COM
        If Not mo_DC_Invoice.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DC_Invoice")
            Call mo_DC_Invoice.Unload_A_COM
            Set mo_DC_Invoice = Nothing
            MouseOn
            Exit Function
        End If
    End If
    mo_DC_Invoice.Visible = True
    Set mo_HandObject = mo_DC_Invoice
    Launch_DC_Invoice = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DC_Invoice = False
    MsgBox "Unable to launch DC_Invoice application: " & Err.Description
    If Not mo_DC_Invoice Is Nothing Then Call Me.Controls.Remove("DC_Invoice")
    Set mo_DC_Invoice = Nothing
End Function

Private Function Launch_DC_Report() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DC_Report Is Nothing Then
    
        Set mo_DC_Report = Me.Controls.Add("Project1.DC_Report", "DC_Report")
        
        mo_DC_Report.Visible = False
        Set mo_DC_Report.ArmDb = aDb
        mo_DC_Report.Language_Code = gut_LangLogin.Code
        mo_DC_Report.U_Code = prg.U_Code
        mo_DC_Report.LoginName = prg.LoginName
        
        Call mo_DC_Report.Load_A_COM
        If Not mo_DC_Report.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DC_Report")
            Call mo_DC_Report.Unload_A_COM
            Set mo_DC_Report = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DC_Report.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_DC_Report.Visible = True
    Set mo_HandObject = mo_DC_Report
    Launch_DC_Report = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DC_Report = False
    MsgBox "Unable to launch DC_Report application: " & Err.Description
    If Not mo_DC_Report Is Nothing Then Call Me.Controls.Remove("DC_Report")
    Set mo_DC_Report = Nothing
End Function

Private Function Launch_DC_PriceList() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DC_PriceList Is Nothing Then
    
        Set mo_DC_PriceList = Me.Controls.Add("Project1.DC_PriceList", "DC_PriceList")
        
        mo_DC_PriceList.Visible = False
        Set mo_DC_PriceList.ArmDb = aDb
        mo_DC_PriceList.TenderCarrier = 0
        mo_DC_PriceList.Language_Code = gut_LangLogin.Code
        mo_DC_PriceList.U_Code = prg.U_Code
        mo_DC_PriceList.LoginName = prg.LoginName
        
        Call mo_DC_PriceList.Load_A_COM
        If Not mo_DC_PriceList.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DC_Report")
            Call mo_DC_PriceList.Unload_A_COM
            Set mo_DC_PriceList = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DC_PriceList.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_DC_PriceList.Visible = True
    Set mo_HandObject = mo_DC_PriceList
    Launch_DC_PriceList = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DC_PriceList = False
    MsgBox "Unable to launch DC PriceList application: " & Err.Description
    If Not mo_DC_PriceList Is Nothing Then Call Me.Controls.Remove("DC_PriceList")
    Set mo_DC_PriceList = Nothing
End Function


Private Function Launch_DC_PriceListTender() As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DC_PriceListTender Is Nothing Then
    
        Set mo_DC_PriceListTender = Me.Controls.Add("Project1.DC_PriceList", "DC_PriceListTender")
        
        mo_DC_PriceListTender.Visible = False
        Set mo_DC_PriceListTender.ArmDb = aDb
        mo_DC_PriceListTender.TenderCarrier = 1
        mo_DC_PriceListTender.Language_Code = gut_LangLogin.Code
        mo_DC_PriceListTender.U_Code = prg.U_Code
        mo_DC_PriceListTender.LoginName = prg.LoginName
        
        Call mo_DC_PriceListTender.Load_A_COM
        If Not mo_DC_PriceListTender.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8729, "You do not have rights to access this application. Please contact your IT support.")
            Call Me.Controls.Remove("DC_Report")
            Call mo_DC_PriceListTender.Unload_A_COM
            Set mo_DC_PriceListTender = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_DC_PriceListTender.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    mo_DC_PriceListTender.Visible = True
    Set mo_HandObject = mo_DC_PriceListTender
    Launch_DC_PriceListTender = True
    
    MouseOn
    Exit Function
onError:
    MouseOn
    Launch_DC_PriceListTender = False
    MsgBox "Unable to launch DC PriceList tender application: " & Err.Description
    If Not mo_DC_PriceListTender Is Nothing Then Call Me.Controls.Remove("DC_PriceListTender")
    Set mo_DC_PriceListTender = Nothing
End Function

Private Function HaveRight(ByVal as_RightKey As String) As Boolean

    Dim mb_Ok As Boolean
    
    mb_Ok = False
    Dim lc_Data As Long
    lc_Data = aDb.OpenSQL("SELECT CFG_Value FROM A_Config WHERE CFG_Key = '" & as_RightKey & "'")
    Dim lv_ArrUpd As Variant
    lv_ArrUpd = Split(aDb.GetFields(lc_Data, 0), SEP, , vbTextCompare)
    aDb.Close (lc_Data)
    Dim ll_Idx As Long, ll_Count As Long
    ll_Count = UBound(lv_ArrUpd)
    For ll_Idx = 0 To ll_Count
        If lv_ArrUpd(ll_Idx) = prg.U_Code Then
            mb_Ok = True
            Exit For
        End If
    Next
    HaveRight = mb_Ok

End Function

Private Sub TSMItemChecker_quit()
    Call HideHandObject
End Sub


Private Sub GEMASOM_OnExit()
    Call HideHandObject
End Sub

' task 415 - support funcs
Private Function GetControl(ByVal ao_array As Object, ByVal as_Name As String) As Object
On Error GoTo ErrHandler
    Dim lo_ctrl As Object
    For Each lo_ctrl In ao_array
        If StrComp(lo_ctrl.Tag, as_Name, vbTextCompare) = 0 Then
            Set GetControl = lo_ctrl
            Exit For
        End If
    Next
    Exit Function
ErrHandler:
    Call ErrorHandler("GetControl()")
End Function

Public Function GetMenuCtrl(ByVal ao_array As Object, ByVal as_Tag As String) As VB.Menu
    Set GetMenuCtrl = GetControl(ao_array, as_Tag)
End Function

' copy of SOM_Customer.LockScreen
Private Sub LockScreen(ByVal ab_lock As Boolean)

    Dim ll_errNumber As Long, ls_ErrSrc As String, ls_ErrDesc As String
    ll_errNumber = Err.Number
    ls_ErrSrc = Err.Source
    ls_ErrDesc = Err.Description

On Error GoTo ErrHandler
    Static ll_Count As Long
    Static ll_Mousepointer As Long
    Static lb_Locked As Boolean

    ll_Count = ll_Count + IIf(ab_lock, 1, -1)
    Debug.Assert (ll_Count >= 0)

    ' First lock
    If Not lb_Locked And ab_lock Then
        ll_Mousepointer = Screen.MousePointer
        Screen.MousePointer = vbHourglass
'        LockWindowUpdate Me.hwnd
        lb_Locked = True
    End If
    
    ' Unlock
    If ll_Count = 0 Then
        DoEvents ' Flush events
'        LockWindowUpdate 0
        Me.Refresh ' Repaint immediately
        Screen.MousePointer = ll_Mousepointer
        lb_Locked = False
    End If
    
    Err.Number = ll_errNumber
    Err.Source = ls_ErrSrc
    Err.Description = ls_ErrDesc
    
    Exit Sub
    
ErrHandler:
    Call ErrorHandler("LockScreen")
End Sub


' ************************************************************************************
' **************************** DB-ACCESS FUNCTIONS ***********************************
' ************************************************************************************

' Execute a SQL request returning no data
' Convert SQL runtime errors and process errors to VB Error
' Params:
' ao_Db (Object)
' as_Request (String)
' al_RowAffectedCount (String)
#If LIVE = 1 Then
Private Sub ExecuteSQLSafe(ByVal ao_Db As Object, ByVal as_Request As String, Optional ByVal al_RowAffectedCount = -1, Optional ab_DuplicityCheck As Boolean = False)
#Else
Private Sub ExecuteSQLSafe(ByVal ao_Db As ARMSYSCOMLib.ArmDb, ByVal as_Request As String, Optional ByVal al_RowAffectedCount = -1, Optional ab_DuplicityCheck As Boolean = False)
#End If
On Error GoTo ErrHandler

    ' First execute the request
    If Not ao_Db.ExecuteSQL(as_Request) Then
        If GetArrayValue(ao_Db.SQLErrorCodes, 0) = 547 Then
            Err.Raise ArmErr.SQLTableReferenceConstraint, "SQL : " & as_Request, Join(ao_Db.SQLErrorCodes, SEP2) & SEP1 & Join(ao_Db.SQLErrorMessages, SEP2)
        End If
        Err.Raise ArmErr.SQLFailure, "SQL : " & as_Request, Join(ao_Db.SQLErrorCodes, SEP2) & SEP1 & Join(ao_Db.SQLErrorMessages, SEP2)
    End If

    If al_RowAffectedCount <> -1 Then
        ' Then check the rowcount
        If ao_Db.SQLRowsAffected <> al_RowAffectedCount Then
            
            If ab_DuplicityCheck Then
                Err.Raise ArmErr.DuplicityDetected, "SQL : " & as_Request, al_RowAffectedCount & "<>" & ao_Db.SQLRowsAffected
            Else
                Err.Raise ArmErr.SQLBadRowAffectedCount, "SQL : " & as_Request, al_RowAffectedCount & "<>" & ao_Db.SQLRowsAffected
            End If
        End If
    End If
    
    Exit Sub

ErrHandler:
    Call ErrorHandler(Me.Name & ".ExecuteSQLSafe")
End Sub

Private Function SqlStr(ByVal as_str As String, Optional ByVal al_MaxLen As Long = 8000) As String
    SqlStr = Replace(Left(as_str, IIf(Len(as_str) <= al_MaxLen, Len(as_str), al_MaxLen)), "'", "''")
End Function
' **************************** DB-ACCESS FUNCTIONS ***********************************

' ************************************************************************************
' ********************** ERROR-HANDLING SUPPORT FUNCTIONS ****************************
' ************************************************************************************
' Standard error handler
Private Sub ErrorHandler(ByVal as_Fct As String)
    Err.Raise Err.Number, as_Fct & SEP1 & Err.Source, Err.Description, Err.HelpFile, Err.HelpContext
End Sub

' display standard error message
' Params:
' as_Fct (String) - Error CallStack
' display standard error message
Private Sub ErrorMessage(ByVal as_Fct As String)
    If Err.Number = QuietException Then Exit Sub
    Dim ll_oldMP As MousePointerConstants
    
    'save mouse pointer
    ll_oldMP = Screen.MousePointer
    Screen.MousePointer = vbDefault
    
    Dim ls_ErrSource As String
    Dim ls_errDescription As String
    ls_ErrSource = as_Fct & SEP1 & Err.Source
    ls_errDescription = Err.Description
    
    Call LogMessage(App.ProductName & " exception raised. Err.Number:" & Err.Number & ", Err.Source:" & ls_ErrSource & ", Err.Description " & ls_errDescription & ".", "E", False)
    Call MsgBox("Error occured, please contact IT" & vbCrLf & ls_ErrSource & vbCrLf & "Description: " & ls_errDescription, , "Error message: " & as_Fct)
    
    'restore mouse pointer
    Screen.MousePointer = ll_oldMP
End Sub


' logs message to database
Private Sub LogMessage(ByVal as_LogMsg As String, Optional ByVal as_LogType As String = "I", Optional ab_throwException As Boolean = True)
On Error GoTo ErrHandler
Const InsertReq As String = "EXEC A_log_ins $UCODE$, '$LOGTYPE$', '$MSG$', '$APP$'"
    Dim ls_req As String
    Dim ll_Cursor As Long
    
    ls_req = Replace(InsertReq, "$UCODE$", CStr(m_UCode))
    ls_req = Replace(ls_req, "$APP$", SqlStr(C_MODULE_NAME & " " & App.Title & " " & App.Major & "." & App.Minor & "." & App.Revision, 50))
    ls_req = Replace(ls_req, "$MSG$", SqlStr(as_LogMsg, 4000))
    ls_req = Replace(ls_req, "$LOGTYPE$", SqlStr(as_LogType), 1)
    
    Call ExecuteSQLSafe(aDb, ls_req)
    
    Exit Sub
ErrHandler:
    If ab_throwException Then Call ErrorHandler(Me.Name & ".LogMessage - " & Err.Number & ": " & Err.Description)
End Sub

' ********************** ERROR-HANDLING SUPPORT FUNCTIONS ****************************

' task 415 - new menu event handlers
Private Sub mnu_subProducts_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subProducts(Index).Tag
    Case "PST"      ' mnu_Standard
        Call mnu_Standard
    Case "PSP"      ' mnu_Special
        Call mnu_Special
    Case "PSE"      ' mnu_SemiSpecial
        Call mnu_SemiSpecial
    Case "MNUQSE"    ' mnu_quick_search
        Call mnu_quick_search
    Case "QFASP"
        Call mnu_qfAsProduct
    Case "METALCMP"
        Call Launch_MetalCompare
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subProducts_Click('" & mnu_subProducts(Index).Tag & "')")
End Sub

Private Sub mnu_subSystems_Click(Index As Integer)
On Error GoTo ErrHandler
    Select Case mnu_subSystems(Index).Tag
    Case "RC", "DCLOAD", "QT", "MNUCG", "GEMA", "MNUPURCH", "EAS", "DPC", "ONSV": ' mnu_RefClaim, mnu_DC_LoadPlan, mnu_Quot, mnu_CaptureGlobal, mnu_GEMA
        ' theese containt submenu
        Exit Sub
    End Select
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subSystems(Index).Tag
    Case "MNUCD"    ' mnu_CubesDownload
        Screen.MousePointer = vbDefault
        Call PWPCPY.show(1)
    Case "WF":      ' mnu_Workflow
        Call DisplayProblem
    Case "INT":     ' mnu_Internet
        Call mnu_Internet(mnu_subSystems(Index).Caption)
    Case "MNUE"      ' mnu_Expend
        Call mnu_Expend
    Case "MNUHR"    ' MNU_hr
        Call Launch_hr
    Case "MNUCDB"   ' mnu_CompetitiveDB
        Call Launch_CompDB
    Case "TIMEMGMT"   ' mnu_TimeMgmt
        Call Launch_TimeMgmt
    Case "MSA" ' mnu_MetalSalesAnalysis
        Call Launch_MetalSalesAnalysis
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subSystems_Click('" & mnu_subSystems(Index).Tag & "')")
End Sub

Private Sub mnu_subPurchasing_Click(Index As Integer)
On Error GoTo ErrHandler
    
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_SubPurchasing(Index).Tag
    Case "IVPO"      ' mnu_IVPO
        Call Launch_IVPO
    Case "SRM"      ' mnu_SRM
        Call Launch_SRM
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subSystems_Click('" & mnu_subSystems(Index).Tag & "')")
End Sub

Private Sub mnu_subClaims_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subClaims(Index).Tag
    Case "C"        ' mnu_Claims
        Set mo_claimManager = Launch_UserControl("Project1.SfbClaimManager", "ClaimManager")
    Case "CREP"     ' mnu_ClaimReporting
        Call mnu_ClaimReporting(mnu_subClaims(Index).Caption)
    Case "GD":      ' mnu_GridDesc
        Call mnu_GridDesc
    Case "GMan":    ' mnu_GridManuf
        Call mnu_GridManuf
    Case "GT":      ' mnu_GridType
        Call mnu_GridType
    Case "N":       ' mnu_Nature
        Call mnu_Nature
    Case "LC":      ' mnu_Letter
        Call mnu_Letter
    Case "CR":      ' mnu_Recommand
        Call mnu_Recommand
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subClaims_Click('" & mnu_subClaims(Index).Tag & "')")
End Sub

Private Sub mnu_subDC_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subDC(Index).Tag
    Case "MNUDCC"       ' mnu_DC_Calendar
        Call mnu_DC_Calendar
    Case "MNUDCW"       ' mnu_DC_Workload
        Call mnu_DC_Workload
    Case "MNUDCO"       ' mnu_DC_Container
        Call mnu_DC_Container
    Case "MNUDCU"       ' mnu_DC_Customer
        Call mnu_DC_Customer
    Case "MNUDCI"       ' mnu_DC_Interco
        Call mnu_DC_Interco
    Case "MNUDCR"       ' mnu_DC_Receipts
        Call mnu_DC_Receipts
    Case "MNUDCE"       ' mnu_DC_Cont_End
        Call mnu_DC_Cont_End
    Case "MNUDCCE"      ' mnu_DC_Cust_End
        Call mnu_DC_Cust_End
    Case "MNUDCIE"      ' mnu_DC_Int_End
        Call mnu_DC_Int_End
    Case "MNUDCRE"      ' mnu_DC_Rec_End
        Call mnu_DC_Rec_End
    Case "MNUDCCT"      ' mnu_DC_Carrier_Table
        Call mnu_DC_Carrier_Table
    Case "MNUDCET"      ' mnu_DC_Equipement_Table
        Call mnu_DC_Equipement_Table
    Case "MNUDCUOM"     ' mnu_DC_UOM_Table
        Call mnu_DC_UOM_Table
    Case "MNUDCINV"
        Call Launch_DC_Invoice
    Case "MNUDCREP"
        Call Launch_DC_Report
    Case "MNUDCPL"
        Call Launch_DC_PriceList
    Case "MNUDCPL_T"
        Call Launch_DC_PriceListTender
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subDC_Click('" & mnu_subDC(Index).Tag & "')")
End Sub

Private Sub mnu_subQuotation_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subQuotation(Index).Tag
    Case "QTM"          ' mnu_QuotationManager
        Call mnu_QuotationManager
    Case "QTC"          ' mnu_QuotC
        Call mnu_QuotC
    Case "QTHF"         ' mnu_QuotHF
        Call mnu_QuotHF
    Case "QTLR"         ' mnu_QuotLR
        Call mnu_QuotLR
    Case "MNUQS"        ' mnu_QuotSystem
        Call mnu_QuotSystem
    Case "MNUQB"        ' mnu_QuotBorder
        Call mnu_QuotBorder
    Case "MNUQF"        ' mnu_QuotFinish
        Call mnu_QuotFinish
    Case "MNUQM"        ' mnu_QuotMaterial
        Call mnu_QuotMaterial
    Case "MNUQG"        ' mnu_QuotGasket
        Call mnu_QuotGasket
    Case "MNUQP"        ' mnu_QuotPerforation
        Call mnu_QuotPerforation
    Case "MNUQE"        ' mnu_QuotEdge
        Call mnu_QuotEdge
    Case "MNUQA"        ' mnu_QuotAcoustic
        Call mnu_QuotAcoustic
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subQuotation_Click('" & mnu_subQuotation(Index).Tag & "')")
End Sub

Private Sub mnu_subCapture_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subCapture(Index).Tag
    Case "MNUC"         ' mnu_Capture
'        MsgBox ("Capture online is not supported in this version!") ' 26.1.2012 JN suppress capture for LIVE test version
        Call Launch_Capture
    Case "RPTV"         ' mnu_CaptureRpt_View
        Call Launch_CaptureRpt_View
    Case "CREP"         ' mnu_CaptureReporting
        Call Launch_CaptureReporting
    Case "REPTOOL"      ' mnu_ReportingTools
        Call Launch_Reporting
    Case "Mnu_Samples"   ' Mnu_samples
        Call Launch_samples
    Case "SPAA" 'SPA Admin
        Call Launch_SPA_Admin
    Case "CAPCLEAN"
        Call Launch_CaptureArchive
    Case "CAPACT"
        Call Launch_CapActivity
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subCapture_Click('" & mnu_subCapture(Index).Tag & "')")
End Sub

Private Sub mnu_SubGEMA_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_SubGEMA(Index).Tag
    Case "GEMASOM"
        Call Launch_GEMASOM
    Case "GEMARATE"     ' Exchange rates
        ' TODO
        Call Launch_GEMARATE
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_SubGEMA_Click('" & mnu_SubGEMA(Index).Tag & "')")
End Sub

Private Sub mnu_SubDPC_Click(Index As Integer)
On Error GoTo ErrHandler

    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_SubDPC(Index).Tag
    Case "CAP_OFFERPROD"
        Call Launch_Cap_OfferProd
    Case "CAP_OFFERTEMP"
        Call Launch_Cap_OfferTemp
    Case "DPC_REF"
        Call Launch_DPC_Ref
    Case "DPC_REF_2"
        Call Launch_DPC_Ref_2
    Case "DPC_REF_SYS"
        Call Launch_DPC_Ref_Sys
    Case "DPC_REF_BOR"
        Call Launch_DPC_Ref_Bor
    Case "DPC_REF_BOM"
        Call Launch_DPC_Ref_Bom
    Case "DPC_REF_SUB"
        Call Launch_DPC_Ref_Sub
    Case "DPC_REF_PRICES"
        Call Launch_DPC_Ref_Prices
    Case "DPC_REF_PDFGENERATOR"
        Call Launch_DPC_Ref_PDFGenerator
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_SubDPC_Click('" & mnu_SubDPC(Index).Tag & "')")
End Sub

Private Sub mnu_SubEAS_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_SubEAS(Index).Tag
    Case "EASCLIENT"
        Call Launch_EAS_Client
    Case "EASVIEWER"
        Call Launch_EAS_Viewer
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_SubEAS_Click('" & mnu_SubEAS(Index).Tag & "')")
End Sub


Private Sub mnu_subRefTables_Click(Index As Integer)
On Error GoTo ErrHandler
    If mnu_subRefTables(Index).Tag <> "SAR" Then
        ' only 'Strategic Account Region' do not containt submenu
        Exit Sub
    End If
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subRefTables(Index).Tag
    Case "SAR"    ' mnu_StrAct_Region
        Call mnu_StrAct_Region
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subRefTables_Click('" & mnu_subRefTables(Index).Tag & "')")
End Sub

Private Sub mnu_subGeneral_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subGeneral(Index).Tag
    Case "CO"           ' mnu_Country
        Call mnu_Country
    Case "PL"           ' mnu_Plant
        Call mnu_Plant
    Case "D"            ' mnu_Distrib
        Call mnu_Distrib
    Case "GM"           ' mnu_Geo
        Call mnu_geo
    Case "ME"           ' mnu_Measure
        Call mnu_Measure
    Case "U"            ' mnu_Unit
        Call mnu_Unit
    Case "Cust"         ' mnu_customer
        Call mnu_Customer
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subGeneral_Click('" & mnu_subGeneral(Index).Tag & "')")
End Sub

Private Sub mnu_subRefTabProducts_Click(Index As Integer)
On Error GoTo ErrHandler
    If mnu_subRefTabProducts(Index).Tag <> "RPP" Then
        ' only 'Referenced Products' do not containt submenu
        Exit Sub
    End If
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subRefTabProducts(Index).Tag
    Case "RPP"    ' mnu_RPP_Click
        Call mnu_RPP
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subRefTabProducts_Click('" & mnu_subRefTabProducts(Index).Tag & "')")
End Sub

Private Sub mnu_subCeilings_Click(Index As Integer)
On Error GoTo ErrHandler
    If mnu_subCeilings(Index).Tag = "SZ" Then
        ' 'Sizes' containt submenu (mnu_CSize)
        Exit Sub
    End If

    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subCeilings(Index).Tag
    Case "PS"           ' mnu_CSurface
        Call mnu_CSurface
    Case "PE"           ' mnu_CEdge
        Call mnu_CEdge
    Case "PP"           ' mnu_CPattern
        Call mnu_CPattern
    Case "PO"           ' mnu_CColour
        Call mnu_CColour
    Case "PF"           ' mnu_CFamily
        Call mnu_CFamily
    Case "PG"           ' mnu_CSegment
        Call mnu_CSegment
    Case "PH"           ' mnu_CShape
        Call mnu_CShape
    Case "PSB"          ' mnu_CSBase
        Call mnu_CSBase
    Case "PB"           ' mnu_CBase
        Call mnu_CBase
    Case "PR"           ' mnu_CLabel
        Call mnu_CLabel
    Case "BIM"          ' mnu_CBI_Marketing
        Call mnu_CBI_Marketing
    Case "PRF"
        Call mnu_CPerforation
    Case "PRFSH"
        Call mnu_CPerforationShape
    Case "FORM"
        Call mnu_CForm
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subCeilings_Click('" & mnu_subCeilings(Index).Tag & "')")
End Sub

Private Sub mnu_subSizes_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subSizes(Index).Tag
    Case "PM"           ' mnu_CModule
        Call mnu_CModule
    Case "PHE"          ' mnu_CHeight
        Call mnu_CHeight
    Case "PD"           ' mnu_CDim
        Call mnu_CDim
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subSizes_Click('" & mnu_subSizes(Index).Tag & "')")
End Sub

Private Sub mnu_subGrids_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subGrids(Index).Tag
    Case "PP"           ' mnu_GPattern
        Call mnu_GPattern
    Case "PO"           ' mnu_GColour
        Call mnu_GColour
    Case "PF"           ' mnu_GFamily
        Call mnu_GFamily
    Case "GO"           ' mnu_GGroup
        Call mnu_GGroup
    Case "PG"           ' mnu_GSegment
        Call mnu_GSegment
    Case "PSB"          ' mnu_GSBase
        Call mnu_GSBase
    Case "PB"           ' mnu_GBase
        Call mnu_GBase
    Case "PR"           ' mnu_GLabel
        Call mnu_GLabel
    Case "BIM"          ' mnu_GBI_Marketing
        Call mnu_GBI_Marketing
    Case "MNUFS"        ' mnu_FirstSlot
        Call mnu_FirstSlot
    Case "MNULS"        ' mnu_LastSlot
        Call mnu_LastSlot
    Case "MNUSS"        ' mnu_SlotSpacing
        Call mnu_SlotSpacing
    Case "MRC"          ' mnu_Main_Runner_Coupling
        Call mnu_Main_Runner_Coupling
    Case "CTD"          ' mnu_Cross_tee_end_details
        Call mnu_Cross_tee_end_details
    Case "CTMRI"        ' mnu_Cross_tee_Main_runner_Interface
        Call mnu_Cross_tee_Main_runner_Interface
    Case "CPT"
        Call mnu_GComponentType
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subGrids_Click('" & mnu_subGrids(Index).Tag & "')")
End Sub

Private Sub mnu_subWalls_Click(Index As Integer)
On Error GoTo ErrHandler
    If mnu_subWalls(Index).Tag = "SZ" Then
        ' 'Sizes' containt submenu (mnu_CSize)
        Exit Sub
    End If

    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subWalls(Index).Tag
    Case "PS"           ' mnu_WSurface
        Call mnu_WSurface
    Case "PP"           ' mnu_WPattern
        Call mnu_WPattern
    Case "PO"           ' mnu_WColour
        Call mnu_WColour
    Case "PF"           ' mnu_WFamily
        Call mnu_WFamily
    Case "GO"           ' mnu_WGroup
        Call mnu_WGroup
    Case "PG"           ' mnu_WSegment
        Call mnu_WSegment
    Case "PSB"          ' mnu_WSBase
        Call mnu_WSBase
    Case "PB"           ' mnu_WBase
        Call mnu_WBase
    Case "PR"           ' mnu_WLabel
        Call mnu_WLabel
    Case "BIM"          ' mnu_WBI_Marketing
        Call mnu_WBI_Marketing
    Case "PRF"
        Call mnu_WPerforation
    Case "PRFSH"
        Call mnu_WPerforationShape
    Case "FORM"
        Call mnu_WForm
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subWalls_Click('" & mnu_subWalls(Index).Tag & "')")
End Sub

Private Sub mnu_subWallsSize_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subWallsSize(Index).Tag
    Case "PM"           ' mnu_WModule
        Call mnu_WModule
    Case "PHE"          ' mnu_WHeight
        Call mnu_WHeight
    Case "PD"           ' mnu_WDim
        Call mnu_WDim
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subWallsSize_Click('" & mnu_subWallsSize(Index).Tag & "')")
End Sub

Private Sub mnu_subAccessCeilings_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subAccessCeilings(Index).Tag
    Case "PP"           ' mnu_EPattern
        Call mnu_EPattern
    Case "PO"           ' mnu_EColour
        Call mnu_EColour
    Case "PF"           ' mnu_EFamily
        Call mnu_EFamily
    Case "GO"           ' mnu_EGroup
        Call mnu_EGroup
    Case "PG"           ' mnu_ESegment
        Call mnu_ESegment
    Case "PSB"          ' mnu_ESBase
        Call mnu_ESBase
    Case "PB"           ' mnu_EBase
        Call mnu_EBase
    Case "PR"           ' mnu_ELabel
        Call mnu_ELabel
    Case "BIM"          ' mnu_EBI_Marketing
        Call mnu_EBI_Marketing
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subAccessCeilings_Click('" & mnu_subAccessCeilings(Index).Tag & "')")
End Sub

Private Sub mnu_subAccessGrids_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subAccessGrids(Index).Tag
    Case "PP"           ' mnu_RPattern
        Call mnu_RPattern
    Case "PO"           ' mnu_RColour
        Call mnu_RColour
    Case "PF"           ' mnu_RFamily
        Call mnu_RFamily
    Case "GO"           ' mnu_RGroup
        Call mnu_RGroup
    Case "PG"           ' mnu_RSegment
        Call mnu_RSegment
    Case "PSB"          ' mnu_RSBase
        Call mnu_RSBase
    Case "PB"           ' mnu_RBase
        Call mnu_RBase
    Case "PR"           ' mnu_RLabel
        Call mnu_RLabel
    Case "BIM"          ' mnu_RBI_Marketing
        Call mnu_RBI_Marketing
    Case "MINL"          ' mnu_MinLength
        Call mnu_MinLength
    Case "MAXL"          ' mnu_MaxLength
        Call mnu_MaxLength
    Case "CPT"
        Call mnu_RComponentType
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subAccessGrids_Click('" & mnu_subAccessGrids(Index).Tag & "')")
End Sub

Private Sub mnu_subAccessWalls_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subAccessWalls(Index).Tag
    Case "PP"           ' mnu_APattern
        Call mnu_APattern
    Case "PO"           ' mnu_AColour
        Call mnu_AColour
    Case "PF"           ' mnu_AFamily
        Call mnu_AFamily
    Case "GO"           ' mnu_AGroup
        Call mnu_AGroup
    Case "PG"           ' mnu_ASegment
        Call mnu_ASegment
    Case "PSB"          ' mnu_ASBase
        Call mnu_ASBase
    Case "PB"           ' mnu_ABase
        Call mnu_ABase
    Case "PR"           ' mnu_ALabel
        Call mnu_ALabel
    Case "BIM"          ' mnu_ABI_Marketing
        Call mnu_ABI_Marketing
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subAccessWalls_Click('" & mnu_subAccessWalls(Index).Tag & "')")
End Sub

Private Sub mnu_subMiscellaneous_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subMiscellaneous(Index).Tag
    Case "PP"           ' mnu_MPattern
        Call mnu_MPattern
    Case "PO"           ' mnu_MColour
        Call mnu_MColour
    Case "PF"           ' mnu_MFamily
        Call mnu_MFamily
    Case "GO"           ' mnu_MGroup
        Call mnu_MGroup
    Case "PG"           ' mnu_MSegment
        Call mnu_MSegment
    Case "PSB"          ' mnu_MSBase
        Call mnu_MSBase
    Case "PB"           ' mnu_MBase
        Call mnu_MBase
    Case "PR"           ' mnu_MLabel
        Call mnu_MLabel
    Case "BIM"          ' mnu_MBI_Marketing
        Call mnu_MBI_Marketing
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subMiscellaneous_Click('" & mnu_subMiscellaneous(Index).Tag & "')")
End Sub

Private Sub mnu_subFinance_Click(Index As Integer)
On Error GoTo ErrHandler
    Select Case mnu_subFinance(Index).Tag
    Case "E": ' mnu_Exchange
        ' theese containt submenu
        Exit Sub
    End Select
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subFinance(Index).Tag
    Case "CU"       ' mnu_Currency
        Call mnu_Currency
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subFinance_Click('" & mnu_subFinance(Index).Tag & "')")
End Sub

Private Sub mnu_subExchange_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subExchange(Index).Tag
    Case "B"            ' mnu_Budgeted
        Call mnu_Budgeted
    Case "O"            ' mnu_Official
        Call mnu_Official
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subExchange_Click('" & mnu_subExchange(Index).Tag & "')")
End Sub

Private Sub mnu_subAdvertising_Click(Index As Integer)
On Error GoTo ErrHandler
    Select Case mnu_subAdvertising(Index).Tag
    Case "MD", "MNURA": ' mnu_Media, mnu_RecArea
        ' theese containt submenu
        Exit Sub
    End Select
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subAdvertising(Index).Tag
    Case "ASSOCF"       ' MNU_assFiles
        Call Launch_assfiles
    Case "MNURP"        ' MNU_refProj
        Call Launch_RefProject
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subAdvertising_Click('" & mnu_subAdvertising(Index).Tag & "')")
End Sub

Private Sub mnu_subMedMan_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subMedMan(Index).Tag
    Case "MM"           ' mnu_MedMan new
        Set mo_medManager = Launch_UserControl("Project1.MediaManager", "MedMan")
    Case "MDP"          ' mnu_Media_on_Dropped_Products
        Call mnu_Media_on_Dropped_Products
    Case "MC1"          ' mnu_MediaControl1
        Call mnu_MediaControl1
    Case "MC2"          ' mnu_MediaControl2
        Call mnu_MediaControl2
    Case "VO"           ' mnu_VO
        Call mnu_VO
    Case "TV"           ' mnu_view
        Call mnu_View
    Case "TOM"          ' mnu_TOM
        Call mnu_TOM
    Case "Interest"     ' mnu_interest
        Call mnu_interest
    Case "SourceT"      ' mnu_source_type
        Call mnu_Source_Type
    Case "ST"           ' mnu_support
        Call mnu_Support
    Case "OWN"          ' mnu_Own
        Call mnu_Own
    Case "AO"           ' mnu_Objectives
        Call mnu_Objectives
    Case "DEF"          ' mnu_Def
        Call mnu_Def
    Case "QONS"         ' mnu_QonS
        Call mnu_QonS
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subMedMan_Click('" & mnu_subMedMan(Index).Tag & "')")
End Sub

Private Sub mnu_subRecArea_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subRecArea(Index).Tag
    Case "MS"           ' mnu_MarkSeg
        Call mnu_MarkSeg
    Case "RE"           ' mnu_Area
        Call mnu_Area
    Case "RAL"          ' mnu_Possible
        Call mnu_Possible
    Case "RAM"          ' mnu_AreaManager
        Set mo_recommArea = Launch_UserControl("Project1.RecommendedArea", "RecommArea")
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subRecArea_Click('" & mnu_subRecArea(Index).Tag & "')")
End Sub

Private Sub mnu_subMarketing_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subMarketing(Index).Tag
    Case "MN"           ' mnu_News
        Call mnu_news
    Case "BUL"          ' mnu_bulletin
        Call mnu_bulletin
    Case "CA"           ' mnu_Category
        Call mnu_Category
    Case "SC"           ' mnu_Super_Category
        Call mnu_Super_Category
    Case "SU"           ' mnu_Supplier
        Call mnu_Supplier
    Case "LM"           ' mnu_Log
        Call mnu_Log
    Case "WPC"
        Call mnu_WPC
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subMarketing_Click('" & mnu_subMarketing(Index).Tag & "')")
End Sub

Private Sub mnu_subTechnical_Click(Index As Integer)
On Error GoTo ErrHandler
    Select Case mnu_subTechnical(Index).Tag
    Case "TT": ' mnu_TestS
        ' theese containt submenu
        Exit Sub
    End Select
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subTechnical(Index).Tag
    Case "TTV"          ' mnu_Value
        Call mnu_Value(mnu_subTechnical(Index).Caption)
    Case "CM"         ' mnu_CM
        Call mnu_CM
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subTechnical_Click('" & mnu_subTechnical(Index).Tag & "')")
End Sub

Private Sub mnu_subTest_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subTest(Index).Tag
    Case "TTM"          ' mnu_Test
        Call Launch_TestManager
    Case "TSMICH"       ' mnu_TSMItemChecker
        Call Launch_TSMItemChecker
    Case "TTK"          ' mnu_TestMarket
        Call mnu_TestMarket
    Case "TTC"          ' mnu_TestCategory
        Call mnu_TestCategory
    Case "TTT"          ' mnu_TestType
        Call mnu_TestType
    Case "TRT"          ' mnu_ReportType -- NO ACTION
    Case "TTS"          ' mnu_TestStandard
        Call mnu_TestStandard
    Case "TTH"          ' mnu_TestHouse
        Call mnu_TestHouse
    Case "TTHA"         ' mnu_TestHouseAcred
        Call mnu_TestHouseAcred
    Case "TTCT"         ' mnu_typ_condition
        Call mnu_typ_condition
    Case "TTCD"         ' mnu_dtl_condition
        Call mnu_dtl_condition
    Case "TTRD"         ' mnu_dtl_result
        Call mnu_dtl_result
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subTest_Click('" & mnu_subTest(Index).Tag & "')")
End Sub

Private Sub mnu_subSales_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subSales(Index).Tag
    Case "SO"           ' mnu_Office
        Call mnu_Office
    Case "SR"           ' mnu_Reps
        Call mnu_Reps
    Case "SRA"          ' mnu_Assignement
        Call mnu_Assignement(mnu_subSales(Index).Caption)
    Case "TR"          ' mnu_Territory
        Call mnu_Territory
    Case "SM"          ' mnu_Sale
        Call mnu_Sale
    Case "SPR"          ' mnu_SalesProject
        Call mnu_SalesProject
    Case "SRPTA"        ' sales reporting area JN 30.4.2013
        Call mnu_Sales_Rpt_Area
    Case "SACR"
        Call mnu_A_CodeTranslator
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subSales_Click('" & mnu_subSales(Index).Tag & "')")
End Sub

Private Sub mnu_subEstimate_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subEstimate(Index).Tag
    Case "MNUESTG"              ' mnu_EstGridType
        Call mnu_EstGridType
    Case "MNUESTAGT"            ' mnu_EstAccGridType
        Call mnu_EstAccGridType
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subEstimate_Click('" & mnu_subEstimate(Index).Tag & "')")
End Sub

Private Sub mnu_subIT_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subIT(Index).Tag
    Case "V"              ' mnu_Viewer
        Call mnu_Viewer
    Case "MT"            ' mnu_Media_type
        Call mnu_Media_type
    Case "FE"            ' mnu_Fe
        Call mnu_Fe
    Case "CC"            ' mnu_Coordinator
        Call mnu_Coordinator
    Case "PC"            ' mnu_PlantContact
        Call mnu_PlantContact
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subIT_Click('" & mnu_subIT(Index).Tag & "')")
End Sub

Private Sub mnu_subMKT_Click(Index As Integer)
On Error GoTo ErrHandler
    Select Case mnu_subMKT(Index).Tag
    Case "MTKM": ' mnu_MKT_Material
        ' theese containt submenu
        Exit Sub
    End Select
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subMKT(Index).Tag
    Case "MTKR"          ' mnu_MKT_Rights
        Call Launch_CompDBRights
    Case "MTKA"          ' mnu_MKT_Attachment
        Call mnu_MKT_Attachment
    Case "MTKB"          ' mnu_MKT_BusMod
        Call mnu_MKT_BusMod
    Case "MTKCH"          ' mnu_MKT_Channel
        Call mnu_MKT_Channel
    Case "MTKC"          ' mnu_MKT_Competitor
        Call mnu_MKT_Competitor
    Case "MTKCM"          ' mnu_MKT_Communication
        Call mnu_MKT_Communication
    Case "MTKCP"          ' mnu_MKT_Compliance
        Call mnu_MKT_Compliance
    Case "MTKP"          ' mnu_MKT_Product
        Call mnu_MKT_Product
    Case "MTKPO"          ' mnu_MKT_Position
        Call mnu_MKT_Position
    Case "MTKPD"          ' mnu_MKT_Production
        Call mnu_MKT_Production
    Case "MTKSO"          ' mnu_MKT_SO
        Call mnu_MKT_SO
    Case "MTKT"          ' mnu_MKT_Technical
        Call mnu_MKT_Technical
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subMKT_Click('" & mnu_subMKT(Index).Tag & "')")
End Sub

Private Sub mnu_subMaterial_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subMaterial(Index).Tag
    Case "MTKSCG"           ' Mnu_MKT_SCG
        Call Mnu_MKT_SCG
    Case "MTKSBM"           ' Mnu_MKT_SBM
        Call Mnu_MKT_SBM
    Case "MTKBM"            ' Mnu_MKT_BM
        Call Mnu_MKT_BM
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subMaterial_Click('" & mnu_subMaterial(Index).Tag & "')")
End Sub

Private Sub mnu_subQueries_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subQueries(Index).Tag
    Case "QP"           ' mnu_QueryProduct
        Call mnu_QueryProduct(mnu_subQueries(Index).Caption)
    Case "QC"           ' mnu_QueryClaim
        Call mnu_QueryClaim(mnu_subQueries(Index).Caption)
    Case "QS"            ' mnu_QuerySales
        Call mnu_QuerySales(mnu_subQueries(Index).Caption)
    Case "MNUQT"         ' mnu_QueryTest
        Call mnu_QueryTest(mnu_subQueries(Index).Caption)
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subQueries_Click('" & mnu_subQueries(Index).Tag & "')")
End Sub

Private Sub mnu_subAbout_Click(Index As Integer)
On Error GoTo ErrHandler
    If lb_IsCommandLocked Then Exit Sub
    lb_IsCommandLocked = True
    Call LockScreen(True)
    Call HideHandObject
    
    Select Case mnu_subAbout(Index).Tag
    Case "T"            ' mnu_AboutTranslator
        Call mnu_AboutTranslator
    Case "TI"           ' mnu_InternetTranslator
        Call mnu_InternetTranslator
    Case "NTI"          ' mnu_NewInternetTranslator
        Call mnu_NewInternetTranslator
    Case "MNUGT"        ' mnu_GlossaryTranslator
        Call mnu_GlossaryTranslator
    Case "password"     ' mnu_Password
        Call mnu_Password
    Case Else
        Call Err.Raise(ArmErr.MNUNotSupported, , "Click event handler is not implemented.")
    End Select

    Call LockScreen(False)
    lb_IsCommandLocked = False
    Exit Sub
ErrHandler:
    Call LockScreen(False)
    lb_IsCommandLocked = False
    Call ErrorMessage(Me.Name & ".mnu_subAbout_Click('" & mnu_subAbout(Index).Tag & "')")
End Sub


Private Function Launch_SPA_Admin() As Boolean

    On Error GoTo onError1
    MouseOff
    
    If mo_SPA_Admin Is Nothing Then
        Set mo_SPA_Admin = Me.Controls.Add("Project1.SPA_Admin_Navig", "SPA_Admin")
        
        mo_SPA_Admin.Visible = False
        mo_SPA_Admin.Language_Code = prg.Session_language_Code
        mo_SPA_Admin.U_Code = prg.U_Code
        mo_SPA_Admin.LoginName = prg.LoginName
        Set mo_SPA_Admin.Db = aDb
        
        Call mo_SPA_Admin.Load_A_COM
        If Not mo_SPA_Admin.Initialized Then
            Call ASC_SendMessage(aDb, prg.Session_language_Code, 8100, "You do not have rights to access this application. Contact the SPA System administrator")
            Call Me.Controls.Remove("SPA_Admin")
            Call mo_SPA_Admin.Unload_A_COM
            Set mo_SPA_Admin = Nothing
            MouseOn
            Exit Function
        End If
        Call mo_SPA_Admin.Move(Zone_Client.Left, Zone_Client.Top, Zone_Client.Width, Zone_Client.Height)
    End If
    
    mo_SPA_Admin.Visible = True
    Set mo_HandObject = mo_SPA_Admin
    
    Launch_SPA_Admin = True
    MouseOn
    Exit Function
    
onError1:
    MouseOn
    If Not mo_SPA_Admin Is Nothing Then
        Call Me.Controls.Remove("SPA_Admin")
        Set mo_SPA_Admin = Nothing
    End If
    Launch_SPA_Admin = False
End Function


Private Function mnu_qfAsProduct()
    Dim myForm As qfASProduct
    Set myForm = New qfASProduct
    Load myForm
    
    myForm.Language_Code = gut_LangLogin.Code
    myForm.LoginName = prg.LoginName
    Set myForm.Db = aDb
    Call myForm.Load_A_COM
    ' Check rights
    myForm.ReadOnly = Not HaveRight("QFASPRD")
    
    Call LockScreen(False)
    
    myForm.show (1)
    
    Unload myForm
    Call LockScreen(True)

End Function

Private Function GetArrayValue(ByRef ao_variantArray As Variant, ByVal al_Index As Long) As Variant
    If IsArray(ao_variantArray) Then
        If UBound(ao_variantArray) <= al_Index Then
            GetArrayValue = ao_variantArray(al_Index)
        Else
            GetArrayValue = 0
        End If
    Else
        GetArrayValue = 0
    End If
End Function


