VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0"; "mscomctl.ocx"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form C_main 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   6570
   ClientLeft      =   240
   ClientTop       =   495
   ClientWidth     =   12075
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   6570
   ScaleWidth      =   12075
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin MSFlexGridLib.MSFlexGrid grd_UnitOfMeasure 
      Height          =   1335
      Left            =   9360
      TabIndex        =   26
      Top             =   5190
      Width           =   2655
      _ExtentX        =   4683
      _ExtentY        =   2355
      _Version        =   393216
   End
   Begin VB.PictureBox pic_Order 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   0  'None
      DragIcon        =   "C_MAIN.frx":0000
      DrawStyle       =   5  'Transparent
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   480
      Left            =   5520
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   14
      Top             =   60
      Width           =   480
   End
   Begin MSFlexGridLib.MSFlexGrid Grid 
      Height          =   735
      Left            =   3060
      TabIndex        =   25
      Top             =   2445
      Visible         =   0   'False
      Width           =   1635
      _ExtentX        =   2884
      _ExtentY        =   1296
      _Version        =   393216
      FixedCols       =   0
   End
   Begin VB.Frame frm_Language 
      BackColor       =   &H00FFFFFF&
      ClipControls    =   0   'False
      ForeColor       =   &H00FFFFFF&
      Height          =   3315
      Left            =   4920
      TabIndex        =   16
      Top             =   480
      Visible         =   0   'False
      Width           =   915
      Begin MSComctlLib.ListView lvw_Language 
         Height          =   3135
         Left            =   60
         TabIndex        =   23
         TabStop         =   0   'False
         Top             =   120
         Width           =   780
         _ExtentX        =   1376
         _ExtentY        =   5530
         View            =   3
         LabelWrap       =   -1  'True
         HideSelection   =   -1  'True
         HideColumnHeaders=   -1  'True
         TextBackground  =   -1  'True
         _Version        =   393217
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         Appearance      =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         NumItems        =   1
         BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
            Object.Width           =   882
         EndProperty
      End
   End
   Begin VB.Frame ButtonBox 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   665
      Left            =   -15
      TabIndex        =   0
      Top             =   15
      Width           =   12015
      Begin VB.PictureBox pic_Memo 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":030A
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   9200
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   21
         Top             =   60
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.PictureBox pic_Excel 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":0614
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   6120
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   20
         TabStop         =   0   'False
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_Language 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":091E
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   4920
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   13
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_help 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":0C28
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   8630
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   8
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_quit 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":0F32
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   8030
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   5
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_add 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":123C
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   120
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   10
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_upd 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":1546
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   720
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   4
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_delete 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   1320
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   9
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_search 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":1850
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   1920
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   3
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_print 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   2520
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   7
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_log 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":1B5A
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   3120
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   6
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_refresh 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         Height          =   480
         Left            =   3720
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   2
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_media 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "C_MAIN.frx":1E64
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   4320
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   1
         Top             =   60
         Width           =   480
      End
   End
   Begin MSComctlLib.ImageList img_pictList 
      Left            =   8685
      Top             =   5220
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      MaskColor       =   8388736
      _Version        =   393216
   End
   Begin VB.TextBox ssp_code 
      Alignment       =   2  'Center
      BackColor       =   &H0080FFFF&
      Height          =   300
      Left            =   1320
      TabIndex        =   22
      Top             =   5520
      Width           =   765
   End
   Begin VB.ListBox lst_ForDelete 
      Height          =   645
      ItemData        =   "C_MAIN.frx":216E
      Left            =   6360
      List            =   "C_MAIN.frx":2170
      TabIndex        =   18
      Top             =   3405
      Visible         =   0   'False
      Width           =   1332
   End
   Begin VB.PictureBox pic_next25 
      AutoSize        =   -1  'True
      Height          =   480
      Left            =   2220
      ScaleHeight     =   420
      ScaleWidth      =   420
      TabIndex        =   17
      Top             =   5460
      Width           =   480
   End
   Begin VB.TextBox txt_Message 
      ForeColor       =   &H00FF0000&
      Height          =   660
      Left            =   2880
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   11
      Top             =   5460
      Visible         =   0   'False
      Width           =   5712
   End
   Begin MSFlexGridLib.MSFlexGrid Grid2 
      Height          =   4095
      Left            =   75
      TabIndex        =   24
      Top             =   1065
      Width           =   11955
      _ExtentX        =   21087
      _ExtentY        =   7223
      _Version        =   393216
      FixedCols       =   0
      Redraw          =   -1  'True
      AllowBigSelection=   0   'False
      FocusRect       =   0
      SelectionMode   =   1
      AllowUserResizing=   1
   End
   Begin VB.Label lbl_MessageCount 
      Height          =   312
      Left            =   8640
      TabIndex        =   19
      Top             =   5820
      Visible         =   0   'False
      Width           =   552
   End
   Begin VB.Label lbl_Rcd 
      Height          =   312
      Left            =   60
      TabIndex        =   15
      Top             =   5520
      Width           =   1152
   End
   Begin VB.Label lbl_Category 
      Height          =   315
      Left            =   60
      TabIndex        =   12
      Top             =   720
      Width           =   9675
   End
End
Attribute VB_Name = "C_main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'what is new
'2.7.1 New View selection (JN)


' gs_TableName is a string to handle special behaviour (e.g. = "Test_Overlay")
' gs_ParamReq1 is the stocked procedure to fill the columns (e.g. = "EXEC Test_Overlay_t_lst '")
' gs_ParamReq2 is the requete to get all values of labels in the screen (e.g. = "EXEC Screen_Csts main_Test_Overlay, '" & gut_LangLogin.Code & "'")
' gs_ParamReq3 is the requete to check the security (e.g. = "EXEC Check_Security Test_Overlay, " & prg.LoginName)
' gi_TranslateType give how may and what type of fields can be translated
' gi_GridWidth(0..i..N) containt how large the column i must be displayed in the cmain window, 1 means that the column must'nt be displayed
' gs_ParamReqIns is the stock procedure to insert data
'

Dim mo_Fetch As Fetch

Dim mi_NbRows As Integer
Dim mi_Yav As Integer
Dim mi_Status As Integer
Dim ml_Hstmt As Long
Dim mb_ServerCursor As Boolean
Dim mb_AllowAdd As Boolean ' flag if the user can add new information
Dim mb_AllowUpd As Boolean ' flag if the user can update new information
Dim mb_AllowDel As Boolean ' flag if the user can delete new information
Dim mb_AllowUpdI As Boolean ' flag if the user can update new information but only if the internet flag is not checked
Dim mb_AllowDelI As Boolean ' flag if the user can delete new information but only if the internet flag is not checked
Dim mb_AllowMemo As Boolean ' flag if the user can use the Memo
Dim ms_LanguagePermission As String
Dim ml_TotCount As Long

Private mo_DC_Contailner As DC_Containers

Public ms_SubMenu As String

Private Enum SRVA_Code
    Claim_View = 1
    SAP_View = 2
    SAP_Incentive_View = 3
End Enum


Private Function Dlt_Table() As Boolean
'used for delete a row from the c_main font

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

On Error GoTo suite

Dlt_Table = KO

MouseOn
If SendMessage(5, "Delete record ?", gut_LangLogin.Code, vbQuestion + vbYesNo, "Delete ") = vbYes Then
    MouseOff
    'start change
    Select Case gs_TableName
    Case "Test_Link_Products"
        ls_req = gs_ParamReqDel & " " & _
            gs_TableCode & ", " _
            & gs_TableCode2
    End Select
    'end change
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        li_Status = SQLRowCount(ll_Statement, ll_lngrows)
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        If ll_lngrows = 0 Then
            SendMessage 7, "Delete failed : concurrency problem ?", gut_LangLogin.Code
            C_main.FillGrid
        Else
            Dlt_Table = OK
            C_main.Grid.RemoveItem C_main.Grid.Row
        End If
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        SendMessage 6, "Delete failed ", gut_LangLogin.Code
    End If
End If
MouseOff
Exit Function

suite:
Select Case Err
Case 30015
    C_main.FillGrid
Case Else
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Select
End Function


Private Sub FillAll()
' Fills invisible grid / by 25 (option mb_ServerCursor)
Dim li_Count, li_Count25 As Integer
Dim i As Integer
Dim j As Integer
Dim li_NBcol As Integer

On Error GoTo suite

li_NBcol = mo_Fetch.NbCol

li_Count = mo_Fetch.FillMore
'All the data must be read
Do While li_Count <> 0
    For i = 1 To li_Count
        Grid.Rows = mi_NbRows + 1
        Grid.Row = mi_NbRows
        'we can read all the columns
        For j = 1 To li_NBcol
            Grid.Col = j - 1
            Grid.Text = mo_Fetch.GetData(i, j)
        Next
        mi_NbRows = mi_NbRows + 1
    Next
    li_Count = mo_Fetch.FillMore
Loop

'the "more 25" picture me be unvisible
pic_next25.Visible = KO

Exit Sub

suite:
pic_next25.Visible = KO
StdError
End Sub
Private Sub DCLoadPrint()

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

On Error GoTo suite

ReDim ms_Print(13, 1) As String
Select Case gs_TableName
Case "DC_Receipts"
    Debug.Assert (False)
Case "DC_Customer"
    Debug.Assert (False)
Case "DC_Interco"
    Debug.Assert (False)
Case "DC_Containers"
    ms_Print(0, 0) = "Customer"
    ms_Print(1, 0) = "Order n°"
    ms_Print(2, 0) = "Shipment n°"
    ms_Print(3, 0) = "Ship to address"
    ms_Print(4, 0) = "ST"
    ms_Print(5, 0) = "Quantity"
    ms_Print(6, 0) = "Cont"
    ms_Print(7, 0) = "Trailer n°"
    ms_Print(8, 0) = "Equip"
    ms_Print(9, 0) = "Remarks"
    ms_Print(10, 0) = "COS Contact"
    ms_Print(11, 0) = "Start"
    ms_Print(12, 0) = ""
    ls_req = "EXEC DC_ShipPrint3 '" & DC_Choice.cbo_ShipDC_code.List(DC_Choice.cbo_ShipDC.ListIndex) & "', '" & FormatD(DC_Choice.txt_ShipDate, "mm/dd/yyyy") & "'"
Case Else
    ms_Print(0, 0) = "Customer"
    ms_Print(1, 0) = "Order n°"
    ms_Print(2, 0) = "Shipment n°"
    ms_Print(3, 0) = "Ship to address"
    ms_Print(4, 0) = "ST"
    ms_Print(5, 0) = "Quantity"
    ms_Print(6, 0) = "Cont"
    ms_Print(7, 0) = "Trailer n°"
    ms_Print(8, 0) = "Equip"
    ms_Print(9, 0) = "Remarks"
    ms_Print(10, 0) = "COS Contact"
    ms_Print(11, 0) = "Start"
    ms_Print(12, 0) = ""
    ls_req = "EXEC DC_ShipPrint5 '" & DC_Choice.cbo_ShipDC_code.List(DC_Choice.cbo_ShipDC.ListIndex) & "', '" & FormatD(DC_Choice.txt_ShipDate, "mm/dd/yyyy") & "', NULL"
End Select

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
            'ReDim Preserve ms_Print(13, UBound(ms_Print, 2) + 1)
            'For i = 0 To 13
            ReDim Preserve ms_Print(13, UBound(ms_Print, 2) + 1)
            For i = 0 To 13
                ms_Print(i, UBound(ms_Print, 2) - 1) = ODBCData(ll_Statement, i + 1)
            Next i
        End If
    Loop
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
DCShipPrint ms_Print, KO

Exit Sub

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

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

On Error GoTo suite

txt_Message = ""
lbl_MessageCount = "0"
Select Case gut_Param.Str11
Case "1"
    ls_req = "EXEC BI_" & gut_Param.Str1 & "_dtl '" _
        & gs_TableCode & "', '" _
        & gs_TableCode3 & "', " _
        & gs_TableCode6 & ", '" _
        & gut_LangWork.Code & "'"
Case "2"
    ls_req = "EXEC BI_" & gut_Param.Str1 & "_dtl '" _
        & gs_TableCode & "', '" _
        & gs_TableCode3 & "', '" & gs_TableCode5 & "', "
    Select Case gut_Param.Str1
    Case "AcoustAW", "AbsClass"
            ls_req = ls_req & gs_TableCode10 & "," & gs_TableCode12 & ", '" _
            & gut_LangWork.Code & "'"
    Case "AcoustNRC"
            ls_req = ls_req & gs_TableCode10 & ", '" _
            & gut_LangWork.Code & "'"
    Case Else
            ls_req = ls_req & gs_TableCode8 & ", '" _
            & gut_LangWork.Code & "'"
    End Select
Case "3"
    ls_req = "EXEC BI_" & gut_Param.Str1 & "_dtl '" _
        & gs_TableCode & "', '" _
        & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', "
    Select Case gut_Param.Str1
    Case "FireReac", "AcoustRW", "AcoustCAC"
            ls_req = ls_req & gs_TableCode12 & ", '" _
            & gut_LangWork.Code & "'"
    Case "AcoustDncW", "Dnfw", "RedInd", "Rain"
            ls_req = ls_req & gs_TableCode12 & "," & gs_TableCode14 & ", '" _
            & gut_LangWork.Code & "'"
    Case Else
            ls_req = ls_req & gs_TableCode10 & ", '" _
            & gut_LangWork.Code & "'"
    End Select
Case "4"
    ls_req = "EXEC BI_" & gut_Param.Str1 & "_dtl '" _
        & gs_TableCode & "', '" _
        & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', '" & gs_TableCode9 & "', "
    Select Case gut_Param.Str1
    Case "FireRes"
            ls_req = ls_req & gs_TableCode14 & ", '" _
            & gut_LangWork.Code & "'"
    Case Else
            ls_req = ls_req & gs_TableCode12 & ", '" _
            & gut_LangWork.Code & "'"
    End Select
Case "5"
    ls_req = "EXEC BI_" & gut_Param.Str1 & "_dtl '" _
        & gs_TableCode & "', '" _
        & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', '" & gs_TableCode9 & "', '" & gs_TableCode11 & "', " _
        & gs_TableCode14 & ", '" _
        & gut_LangWork.Code & "'"
End Select
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            txt_Message = txt_Message & ODBCData(ll_Statement, 1) & Chr(13) & Chr(10)
            lbl_MessageCount = CInt(lbl_MessageCount) + 1
        End If
    Loop
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

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


Private Sub FillListProductsDetail()
Const LINK_WITH_CRITERIA As Integer = 2
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_req As String

On Error GoTo suite

txt_Message = ""
lbl_MessageCount = "0"
' link with criteria
If gs_TableCode3 = LINK_WITH_CRITERIA Then
    ls_req = "Exec Test_Link_Products_t_Lst5 " & gs_TableCode
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                txt_Message = txt_Message & ODBCData(ll_Statement, 1) & Chr(13) & Chr(10)
                lbl_MessageCount = CInt(lbl_MessageCount) + 1
            End If
        Loop
    End If
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Else 'link directly with a product
     txt_Message = txt_Message & gs_TableCode6 & Chr(13) & Chr(10)
     lbl_MessageCount = CInt(lbl_MessageCount) + 1
End If
Exit Sub

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

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

On Error GoTo suite

txt_Message = ""
ls_req = "EXEC Customer_dtl '" & QuoteParam(gs_TableCode) & "','" & QuoteParam(gs_TableCode7) & "','" & gut_LangWork.Code & "'"
If SQLSubmitServer(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        i = Grid.Row
        Grid.Row = 0
        Grid.Col = 0
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 1) & Chr(13) & Chr(10)
        Grid.Col = 6
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 2) & Chr(13) & Chr(10)
        Grid.Col = 5
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 3) & Chr(13) & Chr(10)
        Grid.Col = 1
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 4) & Chr(13) & Chr(10)
        Grid.Col = 7
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 5) & Chr(13) & Chr(10)
        Grid.Col = 8
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 6) & Chr(13) & Chr(10)
        Grid.Col = 9
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 7) & Chr(13) & Chr(10)
        Grid.Col = 10
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 8) & Chr(13) & Chr(10)
        Grid.Col = 11
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 9) & Chr(13) & Chr(10)
        Grid.Col = 12
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 10) & Chr(13) & Chr(10)
        Grid.Col = 13
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 11) & Chr(13) & Chr(10)
        Grid.Col = 14
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 12) & Chr(13) & Chr(10)
        Grid.Col = 15
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 13) & Chr(13) & Chr(10)
        Grid.Col = 16
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 14) & Chr(13) & Chr(10)
        Grid.Col = 17
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 15) & Chr(13) & Chr(10)
        Grid.Col = 18
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 16) & Chr(13) & Chr(10)
        Grid.Col = 19
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 17) & Chr(13) & Chr(10)
        Grid.Col = 20
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 18) & Chr(13) & Chr(10)
        Grid.Col = 3
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 19) & Chr(13) & Chr(10)
        Grid.Col = 21
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 20) & Chr(13) & Chr(10)
        Grid.Col = 2
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 21) & Chr(13) & Chr(10)
        Grid.Col = 22
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 22) & Chr(13) & Chr(10)
        Grid.Col = 23
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 23) & Chr(13) & Chr(10)
        Grid.Col = 24
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 24) & Chr(13) & Chr(10)
        Grid.Col = 25
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 25) & Chr(13) & Chr(10)
        Grid.Col = 26
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 26) & Chr(13) & Chr(10)
        Grid.Col = 4
        txt_Message = txt_Message & Grid.Text & " : " & ODBCData(ll_Statement, 27) & Chr(13) & Chr(10)
        Grid.Row = i
    End If
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

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

Private Sub Form_Unload(Cancel As Integer)

Set mo_Fetch = Nothing

If Not mo_DC_Contailner Is Nothing Then
    Call mo_DC_Contailner.Unload_A_Com
    Set mo_DC_Contailner = Nothing
End If

If gs_WorkFlow = "yes" Then
    ProblemsDelete
    gs_WorkFlow = "no"
End If
gut_LangWork = gut_LangLogin

End Sub

Public Sub Grid_Click()

Grid.Row = Grid2.Row    '.SelStartRow
' Display message down
If gs_WorkFlow = "yes" Then
    Grid.Col = 5
    txt_Message = Grid.Text
    txt_Message.Visible = OK
Else
    txt_Message.Visible = KO
    lbl_MessageCount.Visible = KO
End If
' Copy selected row into variables
Grid.Col = 0
gs_TableCode = Grid.Text
Grid.Col = 1
gs_TableCode2 = Grid.Text
Grid.Col = 2
gs_TableCode3 = Grid.Text
Grid.Col = 3
gs_TableCode4 = Grid.Text
Grid.Col = 4
gs_TableCode5 = Grid.Text
Grid.Col = 5
gs_TableCode6 = Grid.Text
Grid.Col = 6
gs_TableCode7 = Grid.Text
Grid.Col = 7
gs_TableCode8 = Grid.Text
Grid.Col = 8
gs_TableCode9 = Grid.Text
Grid.Col = 9
gs_TableCode10 = Grid.Text
Grid.Col = 10
gs_TableCode11 = Grid.Text
Grid.Col = 11
gs_TableCode12 = Grid.Text
Grid.Col = 12
gs_TableCode13 = Grid.Text
Grid.Col = 13
gs_TableCode14 = Grid.Text
Grid.Col = 14
gs_TableCode15 = Grid.Text
Grid.Col = 15
gs_TableCode16 = Grid.Text
Grid.Col = 16
gs_TableCode17 = Grid.Text
Grid.Col = 17
gs_TableCode18 = Grid.Text
Grid.Col = 18
gs_TableCode19 = Grid.Text
Grid.Col = 19
gs_TableCode20 = Grid.Text

End Sub

Private Sub Grid2_Click()

MouseOff

If gl_NbLineDisplay > 0 And Grid2.Row > 0 Then
    If Grid2.Row = mi_Yav Then
        Grid2.HighLight = flexHighlightNever
        Grid2.Row = 0
        If gs_WorkFlow = "yes" Then
            txt_Message = ""
        End If
    Else
        Grid2.HighLight = flexHighlightAlways
        Grid_Click
    End If
    mi_Yav = Grid2.Row
Else
    Grid2.HighLight = flexHighlightNever
    mi_Yav = 0
End If

If StrComp(gs_TableName, "DC_Work", vbTextCompare) = 0 Then
'mmmm 28.9.2009
    If Grid2.TextMatrix(Grid2.Row, 0) <> "" Then
        Dim ls_req As String
        ls_req = gs_ParamReq4
        ls_req = ls_req & "'" & FormatD(Grid2.TextMatrix(Grid2.Row, 0), "mm/dd/yyyy") & "'"
        Call FillUnitOfMeasureFromSP(grd_UnitOfMeasure, ls_req)
    Else
        grd_UnitOfMeasure.Visible = False
    End If
End If

ShowButtons

MouseOn

End Sub
Private Sub Grid2_DblClick()

MouseOff
If Grid2.HighLight = flexHighlightAlways Then
    gs_Action = "MoreInfo"
    Select Case gs_TableName
        ' REMOVED 7.11.2005 JULO
'        Case "Area_Manager"
'            AreaManager_Mtnc.show 1
        Case "Claim_Coordinator"
            Claim_Coord.show 1
        Case "Colours"
            Colour_mtnc.show 1
        Case "Company_Activity"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Company_Ac', '" & gut_LangLogin.Code & "'"
            C_SimpleDesc_mtnc.show 1
        Case "Offer_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Offer_Type', '" & gut_LangLogin.Code & "'"
            C_SimpleDesc_mtnc.show 1
        Case "Criteria_Choice"
            ' requete to get the screen label of each fields
            gut_Param.Str7 = "EXEC Screen_Csts mtnc_CritChoice, '"
            ' requete to fill the two lists
            gut_Param.Str8 = "EXEC Criteria_Choice_Link_cbo "
            gut_Param.Str9 = "EXEC Criteria_Choice_Link_cbo2 "
            ' the key of the table Criteria Choice is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
        Case "Criteria_List"
            ' requete to get the screen label of each fields
            gut_Param.Str7 = "EXEC Screen_Csts mtnc_CritList, '"
            ' requete to fill the two lists
            gut_Param.Str8 = "EXEC Criteria_List_Link_cbo "
            gut_Param.Str9 = "EXEC Criteria_List_Link_cbo2 "
            ' the key of the table Criteria Choice is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
        Case "Customer"
            FillCustomerDetail
            txt_Message.Visible = OK
        Case "DC_Interco", "DC_Int_End"
            Debug.Assert (False)
        Case "DC_Receipts", "DC_Rec_End"
            Debug.Assert (False)
        Case "DC_Containers", "DC_Cont_End"
           gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Containers', '" & gut_LangLogin.Code & "'"
           Call Launch_DC_Container(gs_TableCode)
'           DC_Containers.show 1
        Case "Dist_Centre"
            Dist_centre_mtnc.show 1
        Case "File_Extension"
            File_ext_mtnc.show 1
        Case "Geographic_Markets"
            C_InOut_Mtnc.show 1
        Case "Grid"
            ' requete to get the screen label of each fields
            gut_Param.Str7 = "EXEC Screen_Csts mtnc_Grid, '"
            ' requete to fill the two lists
            gut_Param.Str8 = "EXEC Grid_Product_Edge_cbo "
            gut_Param.Str9 = "EXEC Grid_Product_Edge_cbo2 "
            ' the key of the table Criteria Choice is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
        Case "Internet_Area"
            C_InOut_Mtnc.show 1
        Case "Logistic_Markets"
            C_InOut_Mtnc.show 1
        Case "Market_Segmentation"
            gut_Param.Str7 = "EXEC Screen_Csts mtnc_RecComb, '"
            gut_Param.Str8 = "EXEC Recommended_Area_cbo2"
            gut_Param.Str9 = "EXEC Recommended_Area_cbo3"
            gut_Param.Str11 = ""
            FillEmpty_Mtnc.show 1
'        Case "Media_Short_Classif"                 ' task409 JN
'            Media_Short_Classif_CMain_DblClick
        Case "Media_CountriesLanguage"
            News_mtnc.ms_MediaCode = gs_TableCode
            News_mtnc.ms_MediaTitle = gs_TableCode2
            News_mtnc.ms_Language = gs_TableCode3
            News_mtnc.ms_LangDesc = gs_TableCode4
            News_mtnc.show 1
        Case "Products_Edges", "Products_Groups"
            ' requete to get the screen label of each fields
            If gs_TableName = "Products_Groups" Then
                gut_Param.Str7 = "EXEC Screen_Csts mtnc_Group, '"
            Else
                gut_Param.Str7 = "EXEC Screen_Csts mtnc_Edge, '"
            End If
            ' requete to fill the two lists
            gut_Param.Str8 = "EXEC Edge_Link_cbo "
            gut_Param.Str9 = "EXEC Edge_Link_cbo2 "
            ' the key of the table Criteria Choice is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
        Case "Products_Patterns"
            ' requete to get the screen label of each fields
            gut_Param.Str7 = "EXEC Screen_Csts mtnc_Pattern, '"
            ' requete to fill the two lists
            gut_Param.Str8 = "EXEC Pattern_Link_cbo "
            gut_Param.Str9 = "EXEC Pattern_Link_cbo2 "
            ' the key of the table Criteria Choice is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
        Case "Problems_ToSolve"
            Select Case gs_TableCode8
            Case "72", "73", "74"
                C_GridDetail.i_NumColumn = 1
                C_GridDetail.s_ScreenConstantsReq = "EXEC Screen_Csts 'WorkDetl_SAP', 'E'"
                C_GridDetail.s_GridReq = " EXEC WorkFlow_Item_t_lst " & gs_TableCode8 & ", " & gs_TableCode9 & ", '" & gs_TableCode10 & "', 'E'"
                C_GridDetail.show 1
            End Select
        Case "Sales_Markets"
            C_InOut_Mtnc.show 1
        Case "Plants"
            Plants_mtnc.show 1
        Case "Claim_Contact"
            Plant_cont_mtnc.show 1
        Case "Possible_Area_Comb"
            PossibleList_Mtnc.show 1
        Case "Sales_Offices", "Int_Stract_Region"
            Sales_off_mtnc.show 1
        Case "SalesProject"
            Sales_project_Mtnc.b_UseWithCMain = OK
            Sales_project_Mtnc.show 1
        Case "Sales_Reps_Assignement"
            Salrepa_mtnc.show 1
        Case "Sales_Reps"
            Salreps_mtnc.show 1
        Case "Super_Base_Material"
            gut_Param.Str7 = "EXEC Screen_Csts mtnc_supbasemat, '"
            gut_Param.Str8 = "EXEC Base_Material_cbo3 '" & gs_CGCode & "',"
            gut_Param.Str9 = "EXEC Base_Material_cbo4 '" & gs_CGCode & "',"
            gut_Param.Str11 = ""
            FillEmpty_Mtnc.show 1
        Case "Surfaces"
            ' requete to get the screen label of each fields
            gut_Param.Str7 = "EXEC Screen_Csts mtnc_Surface, '"
            ' requete to fill the two lists
            gut_Param.Str8 = "EXEC Surface_Link_cbo "
            gut_Param.Str9 = "EXEC Surface_Link_cbo2 "
            ' the key of the table Criteria Choice is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
            
        Case "Suppliers"
            Supplie_mtnc.show 1
        Case "Tech_Value"
            FillTechDetail
            txt_Message.Visible = OK
            lbl_MessageCount.Visible = OK
        Case "Tech_Value_Curve"
            Tech_Value_Curve.show 1
        Case "TopBottomPage"
            MouseOff
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_TopBottom'"
            gs_Param2Req1 = "EXEC position_cbo"
            gs_Param2Req2 = "EXEC companies_cbo1"
            gs_Param2Req3 = "EXEC TopBottomPage_sel " & gs_TableCode
            gut_Param.Str1 = "2"
            gut_Param.Str2 = "OK"
            gut_Param.Str3 = "OK"
            gut_Param.Str4 = "KO"
            gut_Param.Str5 = gs_TableCode
            gut_Param.Str6 = ""
            gut_Param.Str7 = gs_TableCode4
            gut_Param.Str8 = gs_TableCode5
            gut_Param.Str9 = gs_TableCode6
            gut_Param.Str10 = gs_TableCode7
            gut_Param.Str11 = gs_TableCode9
            gut_Param.Str12 = gs_TableCode11
            gut_Param.Str13 = gs_TableCode2
            C_MemoCombo.show 1
            MouseOn
        Case "Value_Type"
            ' requete to get the screen label of each fields
            gut_Param.Str7 = "EXEC Screen_Csts mtnc_Value_Type, '"
            ' requete to fill the two lists
            gut_Param.Str8 = "EXEC Value_Type_Link_cbo "
            gut_Param.Str9 = "EXEC Value_Type_Link_cbo2 "
            ' the key of the table Criteria Choice is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
        Case "Territories"
            Territo_mtnc.show 1
            
            
        Case "Test_Market"
            Test_Market_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(3, 5, 6), Array(KO, KO, KO)
        Case "Test_Category"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Test_Categ'"
            C_SimpleDesc_mtnc.show 1
        Case "Test_Type"
            Test_Type_mtnc.show 1
        Case "Test_Typ_Condition"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_typcnd', '" & gut_LangLogin.Code & "'"
            C_monodesc_mtnc.show 1
        Case "Test_Dtl_Condition"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_dtlcnd'"
            C_DescCbo_mtnc.show 1
        Case "Test_Standard"
            Test_Standard_mtnc.show 1
        Case "Test_House"
            Test_House_mtnc.show 1
        Case "Test_Dtl_Result"
            Test_Standard_mtnc.show 1
        Case "Test_House_Acred"
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Test_THOA', '"
            FillEmpty_Mtnc.show 1
        Case "Test_Link_Products"
            FillListProductsDetail
            txt_Message.Visible = OK
            lbl_MessageCount.Visible = OK
        Case "Quot_LoseReason"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_LoseReason' , '" & gut_LangLogin.Code & "'"
            C_monodesc_mtnc.show 1
        Case "Quot_Comment"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QuotComm',"
            C_Memo.show 1
        Case "DGrid_MainRunner"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_MainRunner', '" & gut_LangLogin.Code & "'"
            gs_Action = "MoreInfo"
            C_categdesc_mtnc.show 1
        Case "DGrid_CrossTee"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_CrossTee', '" & gut_LangLogin.Code & "'"
            gs_Action = "MoreInfo"
            C_categdesc_mtnc.show 1
        Case "DGrid_Interface"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_Interface', '" & gut_LangLogin.Code & "'"
            gs_Action = "MoreInfo"
            C_categdesc_mtnc.show 1
        Case "DGrid_Group"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_DGrid_Group', '" & gut_LangLogin.Code & "'"
            gs_Action = "MoreInfo"
            C_categdesc_mtnc.show 1
        Case "Ceiling_InternetGroup"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_Ceil_IntGroup', '" & gut_LangLogin.Code & "'"
            gs_Action = "MoreInfo"
            C_categdesc_mtnc.show 1
        Case "ProductsFamilies_Group"
            PF_mtnc.show 1
        Case "AccProductsFamilies_Group"
            PF_mtnc.show 1
        Case "PFG_Category"
            Categories_mtnc.show 1
        Case "APFG_Category"
            Categories_mtnc.show 1
        Case "Products_Families"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Family', '" & gut_LangLogin.Code & "'"
            gs_Action = "MoreInfo"
            C_categdesc_mtnc.show 1
    End Select
End If

MouseOn

End Sub

Private Sub Grid2_KeyUp(KeyCode As Integer, Shift As Integer)

Grid2.HighLight = flexHighlightNever
Grid2.Row = 0
Grid2.Col = 0

End Sub


Private Sub lvw_Language_Click()
Dim li_SvgSel As Integer

MouseOff
If Not lvw_Language.SelectedItem Is Nothing Then
    frm_Language.Visible = KO
    gut_LangWork.Code = GetTagValue(lvw_Language.SelectedItem, 0)
    gut_LangWork.Desc = GetTagValue(lvw_Language.SelectedItem, 1)
    gut_LangWork.Icon = GetTagValue(lvw_Language.SelectedItem, 2)
    pic_Language.Picture = img_pictList.ListImages(lvw_Language.SelectedItem.SmallIcon).Picture
    ShowButtons
    FillGrid
End If
MouseOn

End Sub

Private Sub lvw_Language_LostFocus()
frm_Language.Visible = KO
End Sub

Private Sub pic_add_Click()

MouseOff
gs_Action = "Add"
gb_Return = KO
Select Case gs_TableName
'Referenced Project/Product
Case "RP_Product"
    C_Formulaire.b_CloseAfterAdd = True
    C_Formulaire.b_FromCMain = True
    C_Formulaire.i_FieldCount = 5
    C_Formulaire.s_ScreenConstantsReq = "EXEC Screen_Csts 'RP_ProductUpd', '" & gut_LangLogin.Code & "'"
    C_Formulaire.s_Req = "EXEC RP_Product_ins $Key$,'$Field1$','$Field2$',$UCode$,'$Field3$','$Field4$','$Field5$'"
    C_Formulaire.e_Action = vbAdd
    C_Formulaire.Field1.b_Mandatory = True
    C_Formulaire.Field2.b_Mandatory = True
    C_Formulaire.ml_Width2 = 8000
    C_Formulaire.mb_NoInternet = True
    C_Formulaire.mb_NextID = True
    C_Formulaire.mb_LoginID = True
    C_Formulaire.s_ReturnLine = "$ID$" & Chr(9) & "$iConc$" & Chr(9) & "$Field1$" & Chr(9) & "$Field2$" & Chr(9) & "$Field3$" & Chr(9) & "$Field4$" & Chr(9) & "$Field5$"
    C_Formulaire.show 1
'Competitive DB
Case "MKT_Attachment_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_AttachmentUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_Attachment_Type_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_BusMod_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_BusModUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_BusMod_Type_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_CHNL_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CHNLUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_CHNL_Type_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_Com_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CommUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_Com_Type_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_Competitor"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CompUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_Competitor_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_ComplianceRNKG"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_Compliance', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_ComplianceRNKG_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_GP_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_GPUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_GP_Type_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_Position"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_PositionUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_Position_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_Prod_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_ProductionUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_Prod_Type_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_SalesOffice_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SOUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_SalesOffice_Type_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_TSRating"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_TechnicalUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_TSRating_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_Super_Categories"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SCGUpd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC MKT_Super_Categories_ins $Key$, '$Desc$', $Creator$, '','',0,0"
    gi_CodeSize = 30
    C_compdesc_mtnc.CompetitiveDB = True
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "MKT_Super_Base_Material"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SBMUpd'"
    gs_ParamReqIns = "EXEC MKT_Super_Base_Material_Ins $Key$, $Cbo$, '$Desc$', $Creator$, '', '', 0, 0"
    C_SimpleDesc_mtnc.CompetitiveDB = True
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "MKT_Base_Material"
    gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_BMUpd'"
    gs_ParamReqIns = "EXEC MKT_Base_Material_Ins $Key$, $Cbo$, '$Desc$', $Creator$, '', '', 0, 0"
    C_SimpleDesc_mtnc.CompetitiveDB = True
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)

Case "BI_Marketing"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_BI_Marketing' , '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC BI_Marketing_ins '" & gs_CGCode & "', "
    gi_CodeSize = 10
    C_monodesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Base_Material"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_basemat', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Base_Material_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Categories"
    Categories_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Claim_Contact"
    Plant_cont_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Claim_Coordinator"
    Claim_Coord.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Claim_Letter"
    Letclai_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
Case "Claim_Nature"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_natclai'"
    gs_ParamReqIns = "EXEC Claim_Nature_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Claim_Recommendation"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_clairec'"
    gs_ParamReqIns = "EXEC Claim_Recommendation_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Colours"
    Colour_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Company_Activity"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Company_Ac'"
    gs_ParamReqIns = "EXEC Company_Activity_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Offer_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Offer_Type'"
    gs_ParamReqIns = "EXEC Offer_Type_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Offer_Internet"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Offer_Int'"
    gs_ParamReqIns = "EXEC Offer_Internet_ins"
    gut_Param.Str1 = "Offer_Internet"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
Case "Countries"
    Country_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Country_Link"
    gut_Param.Str1 = ""
    gut_Param.Str2 = "EXEC Country_Link_ins "
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CountryLink', '"
    gut_Param.Str8 = "EXEC Internet_Language_cbo "
    gut_Param.Str9 = "EXEC Internet_Language_cbo2 "
    FillEmpty_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Criteria_Choice"
    gut_Param.Str1 = "EXEC Criteria_Choice_ins "
    gut_Param.Str2 = "EXEC Criteria_Choice_Link_ins "
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CritChoice', '"
    ' requete to fill the selected an the not selected list
    gut_Param.Str8 = "EXEC Criteria_Choice_Link_cbo "
    gut_Param.Str9 = "EXEC Criteria_Choice_Link_cbo2 "
    ' the key of the table is an integer
    gut_Param.Str11 = "Integer"
    FillEmpty_Mtnc.show 1
    ' sort the grid
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Criteria_List"
    gut_Param.Str1 = "EXEC Criteria_List_ins "
    gut_Param.Str2 = "EXEC Criteria_List_Link_ins "
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CritList', '"
    ' requete to fill the selected an the not selected list
    gut_Param.Str8 = "EXEC Criteria_List_Link_cbo "
    gut_Param.Str9 = "EXEC Criteria_List_Link_cbo2 "
    ' the key of the table is an integer
    gut_Param.Str11 = "Integer"
    FillEmpty_Mtnc.show 1
    ' sort the grid
    If gb_Return Then GridSort Grid, Array(3, 5, 6), Array(KO, KO, KO)
Case "Currencies"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_currenc', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Currencies_ins"
    gi_CodeSize = 5
    C_monodesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "DC_Interco"
    Debug.Assert (False)
Case "DC_Customer"
    Debug.Assert (False)
Case "DC_Receipts"
    Debug.Assert (False)
Case "DC_Containers"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Containers', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DC_Containers_ins '" & FormatD(DC_Choice.txt_ShipDate, "mm/dd/yyyy") & "', '" & DC_Choice.cbo_ShipDC_code.List(DC_Choice.cbo_ShipDC.ListIndex) & "', "
    Call Launch_DC_Container(0)
'    DC_Containers.show 1
    FillGrid
Case "DC_Calendar"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Calendar', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DC_Max_Activity_ins '" & DC_Choice2.cbo_Ship_DC_code.List(DC_Choice2.cbo_Ship_DC.ListIndex) & "', "
    DC_Calendar.show 1
    If gb_Return Then GridSort Grid, Array(0), Array(KO)
Case "DC_Carrier"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Carrier', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DC_Carrier_ins"
    gi_CodeSize = 4
    DC_CarrierComp.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "DC_Equipement"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Equipement', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DC_Equipement_ins"
    gi_CodeSize = 30
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "DC_UOM"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_UOM', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DC_UOM_ins"
    gi_CodeSize = 4
    C_compdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Definition"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Definition'"
    gs_ParamReqIns = "EXEC Media_Definition_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Dist_Centre"
    Dist_centre_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Budgeted_Exchange_Rates"
    ExchangeRate_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1, 2), Array(KO, OK)
Case "Exchange_Rates"
    ExchangeRate_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1, 2, 3), Array(KO, OK, OK)
Case "Estimate_GridType"
    If gs_CGCode = "C002" Then
    gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstType', '" & gut_LangLogin.Code & "'"
    Else
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstType4', '" & gut_LangLogin.Code & "'"
    End If
    gs_ParamReqIns = "EXEC Estimate_GridType_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Estimate_Length"
    gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstLength', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Estimate_Length_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Estimate_Slot"
    gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstSlot', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Estimate_Slot_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "File_Extension"
    File_ext_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Geographic_Markets"
    C_InOut_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Glossary"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Glossary',"
    gs_ParamReqIns = "EXEC Glossary_ins"
    C_Memo.show 1
    If gb_Return Then GridSort Grid, Array(0, 1), Array(KO, KO)
Case "Grid_Description"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Desc'"
    gs_ParamReqIns = "EXEC Grid_Description_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Grid_Manufacturer"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Man'"
    gs_ParamReqIns = "EXEC Grid_Manufacturer_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Grid_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Type'"
    gs_ParamReqIns = "EXEC Grid_Type_ins"
    gut_Param.Str1 = "EXEC Grid_Manufacturer_cbo '" & gut_LangWork.Code & "'"
    gut_Param.Str2 = "Integer"
    C_DescCbo_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Hyper_Base_Material"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_HyperBM'"
    gs_ParamReqIns = "EXEC Hyper_Base_Material_ins"
    gut_Param.Str1 = "Hyper_Base_Material"
    C_SimpleDesc_mtnc.show 1
    ' after an add function we sort the grid
    If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
Case "Internet_Area"
    C_InOut_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Media_Interest"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Interest'"
    gs_ParamReqIns = "EXEC Media_Interest_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Logistic_Markets"
    C_InOut_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Sales_Markets"
    C_InOut_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Market_Objectives"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Objectives'"
    gs_ParamReqIns = "EXEC Media_Market_Objectives_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Market_Segmentation"
    gut_Param.Str1 = "EXEC Market_Segmentation_ins"
    gut_Param.Str2 = "EXEC Recommended_Comb_ins"
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_RecComb', '"
    gut_Param.Str8 = "EXEC Recommended_Area_cbo2"
    gut_Param.Str9 = "EXEC Recommended_Area_cbo3"
    gut_Param.Str11 = ""
    FillEmpty_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Measurement_System"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_measyst', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Measurement_System_ins"
    gi_CodeSize = 1
    C_monodesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Media_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Media_Type'"
    gs_ParamReqIns = "EXEC Media_Type_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Media_CountriesLanguage"
    gs_Action = "add"
    News_mtnc.show 1
    If gb_Return Then
        GridSort Grid, Array(2), Array(KO)
        frm_im_main.Tv_MediaOutline.LocalAddItem gs_MediaCode
    End If
Case "Owner"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Owner'"
    gs_ParamReqIns = "EXEC Owner_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Plants"
    Plants_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Possible_Area_Comb"
    PossibleList_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Priv_Labels"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_privlab', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Priv_Labels_ins"
    gi_CodeSize = 2
    C_monodesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Pattern_Group"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_PatGroup'"
    gs_ParamReqIns = "EXEC Pattern_Group_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Product_Combine"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_ProdComb'"
    gs_ParamReqIns = "EXEC Product_Combine_ins"
    gut_Param.Str1 = "Product_Combine"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2, 3), Array(KO, KO)
Case "Product_Dimension"
    ProdDim_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(3, 5, 7, 9), Array(KO, KO, KO, KO)
Case "Product_Height"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_height', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Product_Height_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(OK)
Case "Product_Module"
    ProdMod_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Products_Edges"
    gut_Param.Str1 = "EXEC Products_Edges_ins "
    gut_Param.Str2 = "EXEC Edge_Link_ins "
    If gs_TableName = "Products_Groups" Then
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Group', '"
    Else
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Edge', '"
    End If
    ' requete to fill the selected an the not selected list
    gut_Param.Str8 = "EXEC Edge_Link_cbo "
    gut_Param.Str9 = "EXEC Edge_Link_cbo2 "
    ' the key of the table is an integer
    gut_Param.Str11 = "Integer"
    FillEmpty_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Products_Groups"
    gut_Param.Str1 = "EXEC Products_Edges_ins2 "
    gut_Param.Str2 = "EXEC Edge_Link_ins "
    If gs_TableName = "Products_Groups" Then
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Group', '"
    Else
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Edge', '"
    End If
    ' requete to fill the selected an the not selected list
    gut_Param.Str8 = "EXEC Edge_Link_cbo "
    gut_Param.Str9 = "EXEC Edge_Link_cbo2 "
    ' the key of the table is an integer
    gut_Param.Str11 = "Integer"
    FillEmpty_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Products_Edges_Memo"
    Products_Edges_Memo
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Products_Families"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Family', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Products_Families_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Products_Patterns"
    gut_Param.Str1 = "EXEC Products_Patterns_ins "
    gut_Param.Str2 = "EXEC Pattern_Link_ins "
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Pattern', '"
    ' requete to fill the selected an the not selected list
    gut_Param.Str8 = "EXEC Pattern_Link_cbo "
    gut_Param.Str9 = "EXEC Pattern_Link_cbo2 "
    ' the key of the table is an integer
    gut_Param.Str11 = "Integer"
    FillEmpty_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Products_Segmentation"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Segment', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Products_Segmentation_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_MetalSystem"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMSY'"
    gs_ParamReqIns = "EXEC Quot_MetalSystem_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_MetalBorder"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMB'"
    gs_ParamReqIns = "EXEC Quot_MetalBorder_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_MetalFinish"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMF'"
    gs_ParamReqIns = "EXEC Quot_MetalFinish_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_MetalMaterial"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMM'"
    gs_ParamReqIns = "EXEC Quot_MetalMaterial_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_MetalGasket"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMG'"
    gs_ParamReqIns = "EXEC Quot_MetalGasket_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_MetalPerforation"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMPE'"
    gs_ParamReqIns = "EXEC Quot_MetalPerforation_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_MetalEdge"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QME'"
    gs_ParamReqIns = "EXEC Quot_MetalEdge_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_MetalAcoustic"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMA'"
    gs_ParamReqIns = "EXEC Quot_MetalAcoustic_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Media_Quality_On_Screen"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Quality'"
    gs_ParamReqIns = "EXEC Media_Quality_On_Screen_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
'Case "Media_Short_Classif"                 ' task409 JN
'    Media_Short_Classif_CMain_Add
Case "Recommended_Area"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Rec_Area'"
    gs_ParamReqIns = "EXEC Recommended_Area_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Sales_Offices", "Int_Stract_Region"
    Sales_off_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "SalesProject"
    Sales_project_Mtnc.b_UseWithCMain = OK
    Sales_project_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Sales_Reps_Assignement"
' JN 11/7/2013 hardcoded srva_code
    Select Case frmMain.GRD_SubMenu.Text
    Case "SRACLM"
        gs_TableCode11 = SRVA_Code.Claim_View
    Case "SRASPA"
        gs_TableCode11 = SRVA_Code.SAP_View
    Case "SRAINT"
        gs_TableCode11 = SRVA_Code.SAP_Incentive_View
    End Select
    Salrepa_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Sales_Reps"
    Salreps_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Shapes"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Shape', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Shapes_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Form"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Shape', '" & gut_LangLogin.Code & "'"     ' JN reuse screen constants from Shape
    gs_ParamReqIns = "EXEC Form_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Perforation_Shape"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Perforation_Shape', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Perforation_Shape_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Perforation"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Perforation', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Perforation_ins"
    Perforation_Design.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Component_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'Component_Type', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Component_Type_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Source_Type"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Source_Type'"
    gs_ParamReqIns = "EXEC Media_Area_Type_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Super_Base_Material"
    gut_Param.Str1 = "EXEC Super_Base_Material_ins '" & gs_CGCode & "',"
    gut_Param.Str2 = "EXEC Base_Material_Link_ins '" & gs_CGCode & "',"
    ' this requete get the screen labels
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_SupBaseMat', '"
    ' requete to fill the two lists
    gut_Param.Str8 = "EXEC Base_Material_cbo3 '" & gs_CGCode & "',"
    gut_Param.Str9 = "EXEC Base_Material_cbo4 '" & gs_CGCode & "',"
    gut_Param.Str11 = ""
    FillEmpty_Mtnc.show 1
    ' we sort the grid
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Super_Categories"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_SupCate' , '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Super_Categories_ins"
    gi_CodeSize = 3
    C_monodesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Suppliers"
    Supplie_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Support"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Support'"
    gs_ParamReqIns = "EXEC Media_Source_Support_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Surfaces"
    gut_Param.Str1 = "EXEC Surfaces_ins "
    gut_Param.Str2 = "EXEC Surface_Link_ins "
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Surface', '"
    ' requete to fill the selected an the not selected list
    gut_Param.Str8 = "EXEC Surface_Link_cbo "
    gut_Param.Str9 = "EXEC Surface_Link_cbo2 "
    ' the key of the table is an integer
    gut_Param.Str11 = "Integer"
    FillEmpty_Mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Surfaces_Memo"
    Surfaces_Memo
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Tech"
    gs_ParamReqCsts = gut_Param.Str8
    gs_ParamReqIns = "EXEC Tech_" & gut_Param.Str1 & "_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then
        Select Case gut_Param.Str1
        Case "FireReac", "FireRes", "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
            GridSort Grid, Array(1, 4), Array(KO, KO)
        Case Else
            GridSort Grid, Array(4), Array(KO)
        End Select
    End If
Case "Tech_Value_Curve"
    gs_ParamReqCsts = gut_Param.Str23
    gs_ParamReqIns = "EXEC Tech_Value_Curve_ins " & gut_Param.Str25 & ", "
    Tech_Value_Curve.show 1
    If gb_Return Then
            GridSort Grid, Array(2), Array(KO)
    End If
Case "Tech_Value_Option"
    gs_ParamReqCsts = gut_Param.Str18
    gs_ParamReqIns = "EXEC Tech_" & gut_Param.Str21 & "_Option_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then
            GridSort Grid, Array(2), Array(KO)
    End If
Case "Territories"
    Territo_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Test_Category"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Test_Categ'"
    gs_ParamReqIns = "EXEC Test_Category_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Test_House"
    Test_House_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Test_Market"
    Test_Market_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(3, 5, 6), Array(KO, KO, KO)
Case "Test_Standard"
    Test_Standard_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2, 4, 6), Array(KO, KO, KO)
Case "Test_Type"
    Test_Type_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1, 4), Array(KO, KO)
Case "Test_Dtl_Result"
    gut_Param.Str1 = "Test_Result"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_dtlrsl', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Test_dtl_Result_ins"
    Test_Standard_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(3), Array(KO)
Case "Test_Dtl_Condition"
    gut_Param.Str1 = "Test_Typ_Condition"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_dtlcnd'"
    gs_ParamReqIns = "EXEC Test_dtl_Condition_ins1"
    C_DescCbo_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(3), Array(KO)
Case "Test_Typ_Condition"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_typcnd', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Test_Typ_Condition_ins"
    C_monodesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Test_Link_Products"
    MouseOff
    gut_Param.Str1 = "Test Link Products choice"
    Lnk_typ.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
    MouseOn
Case "TopBottomPage"
    MouseOff
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_TopBottom'"
    gs_Param2Req1 = "EXEC position_cbo"
    gs_Param2Req2 = "EXEC companies_cbo1"
    gs_ParamReqIns = "EXEC TopBottomPage_Ins 2"
    gut_Param.Str1 = "2"
    gut_Param.Str2 = "OK"
    gut_Param.Str3 = "OK"
    gut_Param.Str4 = "KO"
    C_MemoCombo.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
    MouseOn
Case "Type_Of_Memo"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Memo_Type'"
    gs_ParamReqIns = "EXEC Media_Type_Of_Memo_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Type_Of_View"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Media_Type_Of_View'"
    gs_ParamReqIns = "EXEC Media_Type_Of_View_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Unit_Of_Measure"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_UniMeas' ,'" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Unit_Of_Measure_ins"
    gi_CodeSize = 4
    C_monodesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Value_Type"
    gut_Param.Str1 = "EXEC Value_Type_ins "
    gut_Param.Str2 = "EXEC Value_Type_Link_ins "
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Value_Type', '"
    ' requete to fill the selected an the not selected list
    gut_Param.Str8 = "EXEC Value_Type_Link_cbo "
    gut_Param.Str9 = "EXEC Value_Type_Link_cbo2 "
    ' the key of the table is an integer
    gut_Param.Str11 = "Integer"
    FillEmpty_Mtnc.show 1
    ' sort the grid
    If gb_Return Then GridSort Grid, Array(3, 5, 6), Array(KO, KO, KO)
Case "Viewer"
    Viewer_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Visible_On"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Visible_On'"
    gs_ParamReqIns = "EXEC Media_Displays_ins"
    C_SimpleDesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(1), Array(KO)
Case "Test_House_Acred"
    gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Test_THOA', '"
    FillEmpty_Mtnc.show 1
Case "Quot_LoseReason"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_LoseReason' , '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Quot_LoseReason_ins '"
    gi_CodeSize = 10
    C_monodesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Quot_Comment"
    gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QuotComm',"
    gs_ParamReqIns = "EXEC Quot_Comment_ins"
    C_Memo.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "DGrid_MainRunner"
    gs_ParamReqCsts = "EXEC Screen_Csts 'm_MainRunner', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DGrid_MainRunner_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "DGrid_CrossTee"
    gs_ParamReqCsts = "EXEC Screen_Csts 'm_CrossTee', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DGrid_CrossTee_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "DGrid_Interface"
    gs_ParamReqCsts = "EXEC Screen_Csts 'm_Interface', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DGrid_Interface_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "DGrid_Group"
    gs_ParamReqCsts = "EXEC Screen_Csts 'm_DGrid_Group', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC DGrid_Group_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "ProductsFamilies_Group"
    PF_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "AccProductsFamilies_Group"
    PF_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
Case "Ceiling_InternetGroup"
    gs_ParamReqCsts = "EXEC Screen_Csts 'm_Ceil_IntGroup', '" & gut_LangLogin.Code & "'"
    gs_ParamReqIns = "EXEC Ceiling_InternetGroup_ins"
    C_categdesc_mtnc.show 1
    If gb_Return Then GridSort Grid, Array(2), Array(KO)
End Select
If gb_Return Then FillGrid3
MouseOn

End Sub



Private Sub Form_Load()

On Error GoTo suite

MouseOff

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

ml_TotCount = 0
pic_Excel.Picture = LoadResPicture(RES_EXCEL, 1)
pic_Order.Picture = LoadResPicture(RES_ORDER, 1)
Select Case gs_TableName
Case "DC_Work"
    pic_help.Picture = LoadResPicture(RES_HELP, 1)
Case "DC_Cont_End"
    pic_upd.Picture = LoadResPicture(RES_MODIFY, 1)
    pic_help.Picture = LoadResPicture(RES_HELP, 1)
Case "Quot_MetalSystem", "Quot_MetalBorder", "Quot_MetalFinish", "Quot_MetalMaterial", "Quot_MetalGasket", "Quot_MetalPerforation", "Quot_MetalEdge", "Quot_MetalAcoustic"
    pic_add.Picture = LoadResPicture(RES_ADD, 1)
    pic_delete.Picture = LoadResPicture(RES_DELETE, 1)
    pic_upd.Picture = LoadResPicture(RES_MODIFY, 1)
    pic_help.Picture = LoadResPicture(RES_HELP, 1)
Case "PFG_Category"
    pic_add.Visible = KO
    pic_delete.Visible = KO
    pic_log.Visible = KO
    pic_upd.Picture = LoadResPicture(RES_MODIFY, 1)
    pic_help.Picture = LoadResPicture(RES_HELP, 1)
    pic_log.Picture = LoadResPicture(RES_LOG, 1)
Case "APFG_Category"
    pic_add.Visible = KO
    pic_delete.Visible = KO
    pic_log.Visible = KO
    pic_upd.Picture = LoadResPicture(RES_MODIFY, 1)
    pic_help.Picture = LoadResPicture(RES_HELP, 1)
    pic_log.Picture = LoadResPicture(RES_LOG, 1)
Case "MediaOnDroppedProducts"
    pic_add.Visible = KO
    pic_delete.Visible = KO
    pic_log.Visible = KO
    pic_upd.Visible = KO
    pic_help.Visible = KO
    pic_log.Visible = KO
Case Else
    pic_add.Picture = LoadResPicture(RES_ADD, 1)
    pic_delete.Picture = LoadResPicture(RES_DELETE, 1)
    pic_upd.Picture = LoadResPicture(RES_MODIFY, 1)
    pic_help.Picture = LoadResPicture(RES_HELP, 1)
    pic_log.Picture = LoadResPicture(RES_LOG, 1)
    pic_Memo.Picture = LoadResPicture(RES_MEMO, 1)
End Select
Select Case gs_TableName
Case "Categories", "Base_Material", "Super_Base_Material", "Products_Edges", "Products_Groups", "Products_Families", "Surfaces", "Products_Patterns", "Shapes", "Colours", "Product_Module", "Products_Segmentation", "Form"
    pic_media.Visible = OK
    pic_media.Picture = LoadResPicture(RES_MEDIA, 1)
Case Else
    pic_media.Visible = KO
End Select
pic_print.Picture = LoadResPicture(RES_PRINT, 1)
pic_quit.Picture = LoadResPicture(RES_QUIT, 1)
pic_refresh.Picture = LoadResPicture(RES_REFRESH, 1)
pic_search.Picture = LoadResPicture(RES_SEARCH, 1)
pic_next25.Picture = LoadResPicture(RES_DOWN, 1)
Grid.Cols = 30
gut_LangWork = gut_LangLogin
InitMainColumns
Permission
ShowOrder

    ' NEW remove ListView begin
    Call InitImageList(img_pictList)
    Call InitListView(lvw_Language, img_pictList)
    ' NEW remove ListView end

MainCsts
Select Case gs_TableName
Case "File_Extension", "Grid", "Product_Dimension", "Product_Height", "Product_Module", "Tech_Value", "Viewer"
    gut_LangWork.Code = "E"
    gut_LangWork.Desc = "English"
    gut_LangWork.Icon = RES_ENGLISH
    pic_Language.Enabled = KO
Case "DC_Calendar", "DC_Work", "DC_Containers", "DC_Carrier", "DC_Equipement", "DC_UOM", "Country_Link", "Tech_Value_Curve", "Grid_Value", "Glossary", "Product_Combine", "Pattern_Group"
    gut_LangWork.Code = "E"
    gut_LangWork.Desc = "English"
    gut_LangWork.Icon = RES_ENGLISH
    pic_Language.Enabled = KO
Case "Quot_Historic"
    gut_LangWork.Code = gs_QuotationLanguageCode
    pic_Language.Visible = KO
    pic_log.Visible = KO
Case "Quot_Comment"
    pic_log.Visible = KO
    FillLvwLanguage lvw_Language
    pic_Language.Enabled = OK
Case "Quot_LoseReason"
    pic_log.Visible = KO
    FillLvwLanguage lvw_Language
    pic_Language.Enabled = OK
Case "SalesProject"
    gut_LangWork.Code = "E"
    pic_Language.Visible = KO
    pic_log.Visible = KO
Case "TopBottomPage"
    pic_log.Visible = KO
    FillLvwLanguage lvw_Language
    pic_Language.Enabled = OK
Case Else
    FillLvwLanguage lvw_Language
    pic_Language.Enabled = OK
End Select
Select Case gs_TableName
Case "Customer", "Tech_Value"
    Grid2.Height = 2300
    txt_Message.Top = 3420
    txt_Message.Height = 2700
End Select
Select Case gs_TableName
Case "Claim_Report1", "Claim_Report2", "Claim_Report3", "Claim_Report4", "Claim_Report5"
    pic_log.Visible = KO
End Select
Select Case gs_TableName
Case "Tech_Value", "Media_CountriesLanguage" ' ,"Area_Manager"
    pic_log.Visible = KO
End Select

pic_Language.Picture = LoadResPicture(gut_LangWork.Icon, 1)
Grid2.Row = 0
ShowButtons

Set mo_Fetch = New Fetch
mo_Fetch.EnvironmentIdentifier = gl_Environment
mo_Fetch.DatabaseIdentifier = gl_Database

FillGrid

Select Case gs_TableName
'mmmm 28.9.2009
    Case "DC_Work"
    Case Else
        grd_UnitOfMeasure.Visible = False
End Select

If gs_TableName = "Media_CountriesLanguage" And ml_TotCount = 0 Then
    pic_add_Click
End If

MouseOn
Exit Sub

suite:
StdError
End Sub

Private Sub FillUnitOfMeasureFromSP(ao_grid As MSFlexGrid, as_Request As String)
    
    Dim lb_status As Boolean
    Dim ls_req As String
    Dim ll_RowCount As Long, ll_ColCount As Long
    Dim ll_Row As Integer, ll_col As Integer
    Dim lo_Fetch As Fetch
    
    Set lo_Fetch = New Fetch
    lo_Fetch.EnvironmentIdentifier = gl_Environment
    lo_Fetch.DatabaseIdentifier = gl_Database

    ao_grid.AllowUserResizing = flexResizeColumns
    ao_grid.Cols = 2
    ao_grid.Rows = 1
    ao_grid.ColWidth(0) = 1200
    ao_grid.ColWidth(1) = 1000
    ao_grid.TextMatrix(0, 0) = "Unit of measure"
    ao_grid.TextMatrix(0, 1) = "Quantity"
    ao_grid.Visible = True
    
    If Not lo_Fetch.ExecuteQry(as_Request, KO) Then Exit Sub
        
    ll_RowCount = lo_Fetch.FillMore
    ll_ColCount = lo_Fetch.NbCol
    
    ao_grid.Cols = ll_ColCount
    ao_grid.Rows = ll_RowCount + 1
    
    For ll_Row = 1 To ll_RowCount
        For ll_col = 1 To ll_ColCount
            ao_grid.TextMatrix(ll_Row, ll_col - 1) = lo_Fetch.GetData(ll_Row, ll_col)
        Next
    Next
    Set lo_Fetch = Nothing
    
End Sub

'Private Sub FillUnitOfMeasure()
''mmmm 11.10.2009
'On Error Resume Next
'    Dim li_unit As Integer
'    Dim li_i As Integer
'    Dim lsa_measures() As String
'    Dim ArrayUnitofmeasures() As String
'    ReDim ArrayUnitofmeasures(Grid2.Rows - 1)
'    Dim lb_newrow As Boolean
'
'    lb_newrow = False
'
'    For li_unit = 1 To Grid2.Rows - 1
'        lsa_measures = Split(Grid2.TextMatrix(li_unit, 3), " ")
'        For li_i = 0 To grd_UnitOfMeasure.Rows - 1
'            If grd_UnitOfMeasure.TextMatrix(li_i, 0) = lsa_measures(1) Then
'                grd_UnitOfMeasure.TextMatrix(li_i, 1) = CSng(grd_UnitOfMeasure.TextMatrix(li_i, 1)) + CSng(lsa_measures(0))
'                lb_newrow = False
'                Exit For
'            End If
'            lb_newrow = True
'        Next
'        If lb_newrow = True Then
'            grd_UnitOfMeasure.AddItem (lsa_measures(1))
'            grd_UnitOfMeasure.Col = 1
'            grd_UnitOfMeasure.Row = grd_UnitOfMeasure.Rows - 1
'            grd_UnitOfMeasure.Text = lsa_measures(0)
'        End If
'    Next
'End Sub

Private Sub pic_Excel_Click()
Dim lo_appExcel As New CExcel
Dim li_Row As Integer
Dim li_Col As Integer
Dim la_Line() As String

On Error GoTo Err_ExportExcel
MouseOff
If pic_next25.Visible Then
     ' The list is not fully loaded
     FillAll
     FillGrid3
End If

ReDim la_Line(Grid2.Cols - 1)

lo_appExcel.NewDocument ""
With lo_appExcel.o_ExcelSheet1
    For li_Row = 0 To Grid2.Rows - 1
        Grid2.Row = li_Row
        For li_Col = 0 To Grid2.Cols - 1
            Grid2.Col = li_Col
            la_Line(li_Col) = ConvertCodePageFromAnsi("'" & Grid2.Text, gl_CodePage)
        Next
        .Range(.cells(li_Row + 1, 1), .cells(li_Row + 1, Grid2.Cols)) = la_Line
    Next
End With
Set lo_appExcel = Nothing
MouseOn
SendMessage 129, "Press ALT+TAB to switch to the Excel application.", gut_LangLogin.Code
Exit Sub

Err_ExportExcel:
    SendMessage 124, "Error on export process.", gut_LangLogin.Code
    MouseOn
End Sub

Private Sub pic_help_Click()

MouseOff
frm_help.show 1
MouseOn

End Sub
Private Sub pic_Language_Click()

MouseOff
frm_Language.Visible = Not frm_Language.Visible
Call lvw_Language.SetFocus
MouseOn

End Sub
Private Sub pic_media_Click()

MouseOff
If Grid2.HighLight = flexHighlightNever Then
    SendMessage 1, "Please, first select a record.", gut_LangLogin.Code
Else
    gs_MediaCode = ""
    gs_Action = ""
    
    gut_Param2.Str1 = "Maintenance"
    gut_Param2.Str2 = "EXEC Media_Product_Classif_cnt "
    gut_Param2.Str3 = "EXEC Media_t_lst '" & gut_LangWork.Code & "', "
    Select Case gs_TableName
    Case "Base_Material"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '" & gs_TableCode & "', '', '', '', '', '', '', '', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '" & gs_TableCode & "', '', '', '', '', '', '', '', ''"
        gut_Param2.Str4 = gs_GridColumn(2)
        gut_Param2.Str5 = gs_TableCode3
    Case "Categories"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_TableCode & "', '', '', '', '', '', '', '', '', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_TableCode & "', '', '', '', '', '', '', '', '', ''"
        gut_Param2.Str4 = gs_GridColumn(2)
        gut_Param2.Str5 = gs_TableCode3
    Case "Colours"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '', '', '', '', '', '', '', '', '" & gs_TableCode & "'"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '', '', '', '', '', '', '', '', '" & gs_TableCode & "'"
        gut_Param2.Str4 = gs_GridColumn(1)
        gut_Param2.Str5 = gs_TableCode2
    Case "Product_Module"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '', '', '', '', '', '', '', '" & gs_TableCode & "', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '', '', '', '', '', '', '', '" & gs_TableCode & "', ''"
        gut_Param2.Str4 = gs_GridColumn(0)
        gut_Param2.Str5 = gs_TableCode
    Case "Products_Edges", "Products_Groups"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '', '', '" & gs_TableCode & "', '', '', '', '', '', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '', '', '" & gs_TableCode & "', '', '', '', '', '', ''"
        gut_Param2.Str4 = gs_GridColumn(2)
        gut_Param2.Str5 = gs_TableCode3
    Case "Products_Families"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '', '', '', '" & gs_TableCode & "', '', '', '', '', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '', '', '', '" & gs_TableCode & "', '', '', '', '', ''"
        gut_Param2.Str4 = gs_GridColumn(2)
        gut_Param2.Str5 = gs_TableCode3
    Case "Products_Patterns"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '', '', '', '', '', '" & gs_TableCode & "', '', '', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '', '', '', '', '', '" & gs_TableCode & "', '', '', ''"
        gut_Param2.Str4 = gs_GridColumn(2)
        gut_Param2.Str5 = gs_TableCode3
    Case "Products_Segmentation"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '', '', '', '', '', '', '" & gs_TableCode & "', '', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '', '', '', '', '', '', '" & gs_TableCode & "', '', ''"
        gut_Param2.Str4 = gs_GridColumn(2)
        gut_Param2.Str5 = gs_TableCode3
    Case "Super_Base_Material":
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '', '" & gs_TableCode & "', '', '', '', '', '', '', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '', '" & gs_TableCode & "', '', '', '', '', '', '', ''"
        gut_Param2.Str4 = gs_GridColumn(2)
        gut_Param2.Str5 = gs_TableCode3
    Case "Surfaces"
        gut_Param2.Str2 = gut_Param2.Str2 & "'" & gs_CGCode & "', '', '', '', '', '" & gs_TableCode & "', '', '', '', ''"
        gut_Param2.Str3 = gut_Param2.Str3 & "'" & gs_CGCode & "', '', '', '', '', '" & gs_TableCode & "', '', '', '', ''"
        gut_Param2.Str4 = gs_GridColumn(2)
        gut_Param2.Str5 = gs_TableCode3
    End Select
    C_media.show 1
End If
MouseOn

End Sub

Private Sub pic_Memo_Click()
Dim ls_SOSLang As String

MouseOff
If Grid2.HighLight = flexHighlightNever Then
    SendMessage 1, "Please, first select a record.", gut_LangLogin.Code
Else
    gb_Return = KO
    If gut_LangWork.Code = "E" Then
        Select Case gs_TableName
        Case "ProductsFamilies_Group", "AccProductsFamilies_Group"
            'this memo uses 2 parameters : str1 & str9, which are the keys of the table
            gut_Param.Str1 = gs_TableCode
            gut_Param.Str2 = "Memo" 'Memo
            gut_Param.Str3 = ""
            gut_Param.Str4 = "EXEC ProductsFamilies_Group_Memo_Ins"
            gut_Param.Str5 = "EXEC ProductsFamilies_Group_Memo_Lst"
            gut_Param.Str6 = "EXEC ProductsFamilies_Group_Memo_Del"
            gut_Param.Str7 = "EXEC ProductsFamilies_Group_Memo_Upd"
            gut_Param.Str8 = "1"
            ls_SOSLang = gut_LangWork.Code
            Memo_mtnc.show 1
            gut_LangWork.Code = ls_SOSLang
        Case "Products_Families"
            gut_Param.Str1 = gs_TableCode
            gut_Param.Str2 = "Memo" 'Memo
            gut_Param.Str3 = ""
            gut_Param.Str4 = "EXEC ProductsFamilies_Memo_Ins"
            gut_Param.Str5 = "EXEC ProductsFamilies_Memo_Lst"
            gut_Param.Str6 = "EXEC ProductsFamilies_Memo_Del"
            gut_Param.Str7 = "EXEC ProductsFamilies_Memo_Upd"
            gut_Param.Str8 = "1"
            gut_Param.Str9 = ""
            ls_SOSLang = gut_LangWork.Code
            Memo_mtnc.show 1
            gut_LangWork.Code = ls_SOSLang
        Case "Surfaces"
            Surfaces_Memo
        Case "Products_Edges", "Products_Groups"
            Products_Edges_Memo
        Case "DGrid_Group"
            gut_Param.Str1 = gs_TableCode
            gut_Param.Str2 = "Memo" 'Memo
            gut_Param.Str3 = ""
            gut_Param.Str4 = "EXEC DGrid_Group_Memo_Ins"
            gut_Param.Str5 = "EXEC DGrid_Group_Memo_Lst"
            gut_Param.Str6 = "EXEC DGrid_Group_Memo_Del"
            gut_Param.Str7 = "EXEC DGrid_Group_Memo_Upd"
            gut_Param.Str8 = "1"
            gut_Param.Str9 = ""
            ls_SOSLang = gut_LangWork.Code
            Memo_mtnc.show 1
            gut_LangWork.Code = ls_SOSLang
        Case "Ceiling_InternetGroup"
            gut_Param.Str1 = gs_TableCode
            gut_Param.Str2 = "Memo" 'Memo
            gut_Param.Str3 = ""
            gut_Param.Str4 = "EXEC Ceiling_InternetGroup_Memo_Ins"
            gut_Param.Str5 = "EXEC Ceiling_InternetGroup_Memo_Lst"
            gut_Param.Str6 = "EXEC Ceiling_InternetGroup_Memo_Del"
            gut_Param.Str7 = "EXEC Ceiling_InternetGroup_Memo_Upd"
            gut_Param.Str8 = "1"
            gut_Param.Str9 = ""
            ls_SOSLang = gut_LangWork.Code
            Memo_mtnc.show 1
            gut_LangWork.Code = ls_SOSLang
        End Select
    End If
    gb_Return = OK
End If
MouseOn
End Sub

Private Sub pic_next25_Click()
Dim li_Count As Integer
Dim li_Count2 As Integer
Dim li_Grid2Col As Integer
Dim li_NbRowsPrev As Integer
Dim li_LastRow As Integer
Dim li_TopRow As Integer

MouseOff
    
    li_NbRowsPrev = Grid.Rows
    li_LastRow = Grid2.Row
    li_TopRow = Grid2.TopRow
    
FillGrid2
    
    On Error GoTo pic_next25_Err
    
    ' Grid sizing (visible grid)
    mi_NbRows = Grid.Rows
    Grid2.Rows = mi_NbRows
    li_Grid2Col = -1
    For li_Count = 0 To 29
        If gi_GridWidth(li_Count) > 1 Then
        ' Cols filling (visible grid)
            Grid.Col = li_Count
            li_Grid2Col = li_Grid2Col + 1
            Grid2.Col = li_Grid2Col
            Grid2.ColWidth(li_Grid2Col) = gi_GridWidth(li_Count)
            For li_Count2 = li_NbRowsPrev To mi_NbRows - 1
                Grid.Row = li_Count2
                Grid2.Row = li_Count2
                Grid2.Text = Grid.Text
            Next li_Count2
        End If
    Next li_Count
    
    Grid.Row = 1
    Grid.Col = 0
    If Grid.Rows = 2 And Grid.Text = "" Then
        gl_NbLineDisplay = 0
    Else
        gl_NbLineDisplay = mi_NbRows - 1
    End If
    If ml_TotCount <= 0 Then
        ssp_code = gl_NbLineDisplay
    Else
        ssp_code = gl_NbLineDisplay & " / " & ml_TotCount   'gl_NbLineDisplay
    End If
    Grid2.Row = li_LastRow
    Grid2.Col = 0
    mi_Yav = 0
    Grid2.HighLight = flexHighlightNever
    Grid2_Click
    Grid2.TopRow = li_TopRow

pic_next25_Err:
MouseOn

End Sub
Private Sub pic_delete_Click()

On Error GoTo suite

MouseOff
If Grid2.HighLight = flexHighlightNever Then
    SendMessage 1, "Please, first select a record.", gut_LangLogin.Code
Else
    gs_Action = "Delete"
    gb_Return = KO
    Select Case gs_TableName
    'RP_Product
    Case "RP_Product"
        C_Formulaire.b_FromCMain = OK
        C_Formulaire.i_FieldCount = 5
        C_Formulaire.s_ScreenConstantsReq = "EXEC Screen_Csts 'RP_ProductUpd', '" & gut_LangLogin.Code & "'"
        C_Formulaire.s_Req = "EXEC RP_Product_del '$ID$',$iConc$ "
        C_Formulaire.e_Action = vbDelete
        C_Formulaire.ml_Width2 = 8000
        C_Formulaire.mb_NoInternet = True
        C_Formulaire.s_ID = gs_TableCode
        C_Formulaire.i_Concurency = gs_TableCode2
        C_Formulaire.Field1.s_InitialValue = gs_TableCode3
        C_Formulaire.Field2.s_InitialValue = gs_TableCode4
        C_Formulaire.Field3.s_InitialValue = gs_TableCode5
        C_Formulaire.Field4.s_InitialValue = gs_TableCode6
        C_Formulaire.Field5.s_InitialValue = gs_TableCode7
        C_Formulaire.show 1
    'Competitive DB
    Case "MKT_Attachment_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_AttachmentUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_Attachment_Type_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_BusMod_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_BusModUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_BusMod_Type_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_CHNL_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CHNLUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_CHNL_Type_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_Com_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CommUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_Com_Type_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_Competitor"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CompUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_Competitor_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_ComplianceRNKG"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_ComplianceUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_ComplianceRNKG_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_GP_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_GPUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_GP_Type_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_Position"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_PositionUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_Position_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_Prod_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_ProductionUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_Prod_Type_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_SalesOffice_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SOUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_SalesOffice_Type_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_TSRating"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_TechnicalUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_TSRating_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_Super_Categories"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SCGUpd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC MKT_Super_Categories_del $Key$, $Creator$"
        gi_CodeSize = 30
        C_compdesc_mtnc.CompetitiveDB = True
        C_compdesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_Super_Base_Material"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SBMUpd'"
        gs_ParamReqDel = "EXEC MKT_Super_Base_Material_del $Key$, $UID$"
        gi_CodeSize = 30
        C_SimpleDesc_mtnc.CompetitiveDB = True
        C_SimpleDesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "MKT_Base_Material"
        gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_BMUpd'"
        gs_ParamReqDel = "EXEC MKT_Base_Material_del $Key$, $UID$"
        gi_CodeSize = 30
        C_SimpleDesc_mtnc.CompetitiveDB = True
        C_SimpleDesc_mtnc.show 1
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    
    Case "BI_Marketing"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_BI_Marketing', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC BI_Marketing_del '" & gs_CGCode & "', "
        C_monodesc_mtnc.show 1
    Case "Base_Material"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Basemat', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Base_Material_del"
        C_categdesc_mtnc.show 1
    Case "Categories"
        Categories_mtnc.show 1
    Case "Claim_Contact"
        Plant_cont_mtnc.show 1
    Case "Claim_Coordinator"
        Claim_Coord.show 1
    Case "Claim_Letter"
        Letclai_mtnc.show 1
    Case "Claim_Nature"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_natclai'"
        gs_ParamReqDel = "EXEC Claim_Nature_del"
        C_SimpleDesc_mtnc.show 1
    Case "Claim_Recommendation"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_clairec'"
        gs_ParamReqDel = "EXEC Claim_Recommendation_del"
        C_SimpleDesc_mtnc.show 1
    Case "Colours"
        Colour_mtnc.show 1
    Case "Company_Activity"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Company_Ac'"
        gs_ParamReqDel = "EXEC Company_Activity_del"
        C_SimpleDesc_mtnc.show 1
    Case "Offer_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Offer_Type'"
        gs_ParamReqDel = "EXEC Offer_Type_del"
        C_SimpleDesc_mtnc.show 1
    Case "Offer_Internet"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Offer_Int'"
        gs_ParamReqDel = "EXEC Offer_Internet_del"
        C_SimpleDesc_mtnc.show 1
    Case "Countries"
        Country_mtnc.show 1
    Case "Country_Link"
        gut_Param.Str4 = "EXEC Country_Link_All_del "
        gut_Param.Str6 = gs_TableCode2
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CountryLink', '"
        gut_Param.Str8 = "EXEC Internet_Language_cbo "
        gut_Param.Str9 = "EXEC Internet_Language_cbo2 "
        FillEmpty_Mtnc.show 1
    Case "Criteria_Choice"
        gut_Param.Str4 = "EXEC Criteria_Choice_del"
        gut_Param.Str6 = gs_TableCode2
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CritChoice', '"
        ' these requetes fill the two list in maintenace screen
        gut_Param.Str8 = "EXEC Criteria_Choice_Link_cbo "
        gut_Param.Str9 = "EXEC Criteria_Choice_Link_cbo2 "
        ' the key of the table Criteria choice is an integer
        gut_Param.Str11 = "Integer"
        FillEmpty_Mtnc.show 1
    Case "Criteria_List"
        gut_Param.Str4 = "EXEC Criteria_List_del"
        gut_Param.Str6 = gs_TableCode2
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CritList', '"
        ' these requetes fill the two list in maintenace screen
        gut_Param.Str8 = "EXEC Criteria_List_Link_cbo "
        gut_Param.Str9 = "EXEC Criteria_List_Link_cbo2 "
        ' the key of the table Criteria choice is an integer
        gut_Param.Str11 = "Integer"
        FillEmpty_Mtnc.show 1
    Case "Currencies"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Currenc', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Currencies_del"
        C_monodesc_mtnc.show 1
    Case "DC_Carrier"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Carrier', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DC_Carrier_del"
        DC_CarrierComp.show 1
    Case "DC_Equipement"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Equipement', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DC_Equipement_del"
        C_compdesc_mtnc.show 1
    Case "DC_UOM"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_UOM', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DC_UOM_del"
        C_compdesc_mtnc.show 1
    Case "DC_Calendar"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Calendar', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DC_Max_Activity_del '" & DC_Choice2.cbo_Ship_DC_code.List(DC_Choice2.cbo_Ship_DC.ListIndex) & "', "
        DC_Calendar.show 1
    Case "DC_Receipts"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Receipts', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DC_Receipts_del"
        DC_Receipts.show 1
    Case "DC_Containers"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Containers', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DC_Containers_del"
        Call Launch_DC_Container(gs_TableCode)
'        DC_Containers.show 1
    Case "Definition"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Definition'"
        gs_ParamReqDel = "EXEC Media_Definition_del"
        C_SimpleDesc_mtnc.show 1
    Case "Dist_Centre"
        Dist_centre_mtnc.show 1
    Case "Estimate_GridType"
        If gs_CGCode = "C002" Then
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstType', '" & gut_LangLogin.Code & "'"
        Else
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstType4', '" & gut_LangLogin.Code & "'"
        End If
        gs_ParamReqDel = "EXEC Estimate_GridType_del"
        C_categdesc_mtnc.show 1
    Case "Estimate_Length"
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstLength', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Estimate_Length_del"
        C_categdesc_mtnc.show 1
    Case "Estimate_Slot"
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstSlot', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Estimate_Slot_del"
        C_categdesc_mtnc.show 1
    Case "Budgeted_Exchange_Rates"
        ExchangeRate_mtnc.show 1
    Case "Exchange_Rates"
        ExchangeRate_mtnc.show 1
    Case "File_Extension"
        File_ext_mtnc.show 1
    Case "Geographic_Markets"
        C_InOut_Mtnc.show 1
    Case "Glossary"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Glossary',"
        gs_ParamReqDel = "EXEC Glossary_del"
        C_Memo.show 1
    Case "Grid_Description"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Desc'"
        gs_ParamReqDel = "EXEC Grid_Description_del"
        C_SimpleDesc_mtnc.show 1
    Case "Grid_Manufacturer"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Man'"
        gs_ParamReqDel = "EXEC Grid_Manufacturer_del"
        C_SimpleDesc_mtnc.show 1
   Case "Grid_Type"
       gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Type'"
       gs_ParamReqDel = "EXEC Grid_Type_del"
       C_DescCbo_mtnc.show 1
    Case "Hyper_Base_Material"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_HyperBM'"
        gs_ParamReqDel = "EXEC Hyper_Base_Material_del"
        C_SimpleDesc_mtnc.show 1
    Case "Internet_Area"
            C_InOut_Mtnc.show 1
    Case "Media_Interest"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Interest'"
        gs_ParamReqDel = "EXEC Media_Interest_del"
        C_SimpleDesc_mtnc.show 1
    Case "Logistic_Markets"
        C_InOut_Mtnc.show 1
    Case "Sales_Markets"
        C_InOut_Mtnc.show 1
    Case "Market_Objectives"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Objectives'"
        gs_ParamReqDel = "EXEC media_Market_Objectives_del"
        C_SimpleDesc_mtnc.show 1
    Case "Market_Segmentation"
        gut_Param.Str4 = "EXEC Market_Segmentation_del"
        gut_Param.Str6 = gs_TableCode2
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_RecComb', '"
        gut_Param.Str8 = "EXEC Recommended_Area_cbo2"
        gut_Param.Str9 = "EXEC Recommended_Area_cbo3"
        gut_Param.Str11 = ""
        FillEmpty_Mtnc.show 1
    Case "Measurement_System"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_MeaSyst', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Measurement_System_del"
        C_monodesc_mtnc.show 1
    Case "Media_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Media_Type'"
        gs_ParamReqDel = "EXEC Media_Type_del"
        C_SimpleDesc_mtnc.show 1
'    Case "Media_Short_Classif"                 ' task409 JN
'        Media_Short_Classif_CMain_Del
    Case "Media_CountriesLanguage"
        gs_Action = "del"
        News_mtnc.ms_MediaCode = gs_TableCode
        News_mtnc.ms_MediaTitle = gs_TableCode2
        News_mtnc.ms_Language = gs_TableCode3
        News_mtnc.ms_LangDesc = gs_TableCode4
        News_mtnc.mi_Conc = gs_TableCode5
        News_mtnc.show 1
        If gb_Return Then frm_im_main.Tv_MediaOutline.LocalDelItem gs_MediaCode
    Case "Owner"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Owner'"
        gs_ParamReqDel = "EXEC Owner_del"
        C_SimpleDesc_mtnc.show 1
    Case "Pattern_Group"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_PatGroup'"
        gs_ParamReqDel = "EXEC Pattern_Group_del"
        C_SimpleDesc_mtnc.show 1
    Case "Product_Combine"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_ProdComb'"
        gs_ParamReqDel = "EXEC Product_Combine_del"
        C_SimpleDesc_mtnc.show 1
    Case "Plants"
        Plants_mtnc.show 1
    Case "Possible_Area_Comb"
        PossibleList_Mtnc.show 1
    Case "Priv_Labels"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_PrivLab', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Priv_Labels_del"
        C_monodesc_mtnc.show 1
    Case "Product_Dimension"
        ProdDim_mtnc.show 1
    Case "Product_Height"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Height', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Product_Height_del"
        C_categdesc_mtnc.show 1
    Case "Product_Module"
        ProdMod_mtnc.show 1
    Case "Products_Edges", "Products_Groups"
        gut_Param.Str4 = "EXEC Products_Edges_del"
        gut_Param.Str6 = gs_TableCode2
        If gs_TableName = "Products_Groups" Then
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Group', '"
        Else
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Edge', '"
        End If
        ' these requetes fill the two list in maintenace screen
        gut_Param.Str8 = "EXEC Edge_Link_cbo "
        gut_Param.Str9 = "EXEC Edge_Link_cbo2 "
        ' the key of the table Criteria choice is an integer
        gut_Param.Str11 = "Integer"
        FillEmpty_Mtnc.show 1
    Case "Products_Edges_Memo"
        Products_Edges_Memo
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "Products_Families"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Family', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Products_Families_del"
        C_categdesc_mtnc.show 1
    Case "Products_Patterns"
        gut_Param.Str4 = "EXEC Products_Patterns_del"
        gut_Param.Str6 = gs_TableCode2
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Pattern', '"
        ' these requetes fill the two list in maintenace screen
        gut_Param.Str8 = "EXEC Pattern_Link_cbo "
        gut_Param.Str9 = "EXEC Pattern_Link_cbo2 "
        ' the key of the table Criteria choice is an integer
        gut_Param.Str11 = "Integer"
        FillEmpty_Mtnc.show 1
    Case "Products_Segmentation"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Segment', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Products_Segmentation_del"
        C_categdesc_mtnc.show 1
    Case "Quot_MetalSystem"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMSY'"
        gs_ParamReqDel = "EXEC Quot_MetalSystem_del"
        C_SimpleDesc_mtnc.show 1
    Case "Quot_MetalBorder"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMB'"
        gs_ParamReqDel = "EXEC Quot_MetalBorder_del"
        C_SimpleDesc_mtnc.show 1
    Case "Quot_MetalFinish"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMF'"
        gs_ParamReqDel = "EXEC Quot_MetalFinish_del"
        C_SimpleDesc_mtnc.show 1
    Case "Quot_MetalMaterial"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMM'"
        gs_ParamReqDel = "EXEC Quot_MetalMaterial_del"
        C_SimpleDesc_mtnc.show 1
    Case "Quot_MetalGasket"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMG'"
        gs_ParamReqDel = "EXEC Quot_MetalGasket_del"
        C_SimpleDesc_mtnc.show 1
    Case "Quot_MetalPerforation"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMPE'"
        gs_ParamReqDel = "EXEC Quot_MetalPerforation_del"
        C_SimpleDesc_mtnc.show 1
    Case "Quot_MetalEdge"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QME'"
        gs_ParamReqDel = "EXEC Quot_MetalEdge_del"
        C_SimpleDesc_mtnc.show 1
    Case "Quot_MetalAcoustic"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMA'"
        gs_ParamReqDel = "EXEC Quot_MetalAcoustic_del"
        C_SimpleDesc_mtnc.show 1
    Case "Media_Quality_On_Screen"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Quality'"
        gs_ParamReqDel = "EXEC Media_Quality_On_Screen_del"
        C_SimpleDesc_mtnc.show 1
    Case "Recommended_Area"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Rec_Area'"
        gs_ParamReqDel = "EXEC Recommended_Area_del"
        C_SimpleDesc_mtnc.show 1
    Case "Sales_Offices", "Int_Stract_Region"
        Sales_off_mtnc.show 1
    Case "SalesProject"
        Sales_project_Mtnc.b_UseWithCMain = OK
        Sales_project_Mtnc.show 1
    Case "Sales_Reps_Assignement"
        Salrepa_mtnc.show 1
    Case "Sales_Reps"
        Salreps_mtnc.show 1
    Case "Shapes"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Shape', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Shapes_del"
        C_categdesc_mtnc.show 1
    Case "Form"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Shape', '" & gut_LangLogin.Code & "'"     ' JN reuse screen constants from Shape
        gs_ParamReqDel = "EXEC Form_del"
        C_categdesc_mtnc.show 1
    Case "Perforation_Shape"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Perforation_Shape', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Perforation_Shape_del"
        C_categdesc_mtnc.show 1
    Case "Perforation"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Perforation', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Perforation_del"
        Perforation_Design.show 1
    Case "Component_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Component_Type', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Component_Type_del"
        C_categdesc_mtnc.show 1
    Case "Source_Type"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Source_Type'"
        gs_ParamReqDel = "EXEC Media_Area_Type_del"
        C_SimpleDesc_mtnc.show 1
    Case "Super_Base_Material"
        gut_Param.Str4 = "EXEC Super_Base_Material_del"
        gut_Param.Str6 = gs_TableCode2
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_SupBaseMat', '"
        ' these requetes fill the two list in maintenace screen
        gut_Param.Str8 = "EXEC Base_Material_cbo3 '" & gs_CGCode & "',"
        gut_Param.Str9 = "EXEC Base_Material_cbo4 '" & gs_CGCode & "',"
        gut_Param.Str11 = ""
        FillEmpty_Mtnc.show 1
    Case "Super_Categories"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_SupCate', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Super_Categories_del"
        C_monodesc_mtnc.show 1
    Case "Suppliers"
        Supplie_mtnc.show 1
    Case "Support"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Support'"
        gs_ParamReqDel = "EXEC Media_Source_Support_del"
        C_SimpleDesc_mtnc.show 1
    Case "Surfaces"
        gut_Param.Str4 = "EXEC Surfaces_del"
        gut_Param.Str6 = gs_TableCode2
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Surface', '"
        ' these requetes fill the two list in maintenace screen
        gut_Param.Str8 = "EXEC Surface_Link_cbo "
        gut_Param.Str9 = "EXEC Surface_Link_cbo2 "
        ' the key of the table Criteria choice is an integer
        gut_Param.Str11 = "Integer"
        FillEmpty_Mtnc.show 1
    Case "Surfaces_Memo"
        Surfaces_Memo
        If gb_Return Then GridSort Grid, Array(2), Array(KO)
    Case "Tech"
        gs_ParamReqCsts = gut_Param.Str8
        gs_ParamReqDel = "EXEC Tech_Value_del"
        C_SimpleDesc_mtnc.show 1
    Case "Tech_Value_Curve"
        gs_ParamReqCsts = gut_Param.Str23
        gs_ParamReqDel = "EXEC Tech_Value_Curve_del " & gut_Param.Str25 & ", "
        Tech_Value_Curve.show 1
    Case "Tech_Value_Option"
        gs_ParamReqCsts = gut_Param.Str18
        gs_ParamReqDel = "EXEC Tech_Value_Option_del"
        C_SimpleDesc_mtnc.show 1
    Case "Territories"
        Territo_mtnc.show 1
    Case "Test_Category"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Test_Categ'"
        gs_ParamReqDel = "EXEC Test_Category_del"
        C_SimpleDesc_mtnc.show 1
    Case "Test_House"
        Test_House_mtnc.show 1
    Case "Test_Market"
        Test_Market_mtnc.show 1
    Case "Test_Standard"
        Test_Standard_mtnc.show 1
    Case "Test_Type"
        Test_Type_mtnc.show 1
    Case "Test_Dtl_Condition"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_dtlcnd'"
        gs_ParamReqDel = "EXEC Test_dtl_Condition_del"
        C_DescCbo_mtnc.show 1
    Case "Test_Typ_Condition"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_typcnd', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Test_Typ_Condition_del"
        C_monodesc_mtnc.show 1
    Case "Test_Link_Products"
        gs_ParamReqCsts = "EXEC Screen_Csts main_link_prod, '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Test_Link_Products_del"
        Dlt_Table
        C_main.FillGrid
    Case "Test_Dtl_Result"
        Test_Standard_mtnc.show 1
    Case "Test_House_Acred"
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Test_THOA', '"
        FillEmpty_Mtnc.show 1
    Case "TopBottomPage"
        MouseOff
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_TopBottom'"
        gs_Param2Req1 = "EXEC position_cbo"
        gs_Param2Req2 = "EXEC companies_cbo1"
        gs_Param2Req3 = "EXEC TopBottomPage_sel " & gs_TableCode
        gs_ParamReqDel = "EXEC TopBottomPage_Del " & gs_TableCode
        gut_Param.Str1 = "2"
        gut_Param.Str2 = "OK"
        gut_Param.Str3 = "OK"
        gut_Param.Str4 = "KO"
        gut_Param.Str5 = gs_TableCode
        gut_Param.Str6 = ""
        gut_Param.Str7 = gs_TableCode4
        gut_Param.Str8 = gs_TableCode5
        gut_Param.Str9 = gs_TableCode6
        gut_Param.Str10 = gs_TableCode7
        gut_Param.Str11 = gs_TableCode9
        gut_Param.Str12 = gs_TableCode11
        gut_Param.Str13 = gs_TableCode2
        C_MemoCombo.show 1
        MouseOn
    Case "Type_Of_Memo"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Memo_Type'"
        gs_ParamReqDel = "EXEC Media_Type_Of_Memo_del"
        C_SimpleDesc_mtnc.show 1
    Case "Type_Of_View"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Media_Type_Of_View'"
        gs_ParamReqDel = "EXEC Media_Type_Of_View_del"
        C_SimpleDesc_mtnc.show 1
    Case "Unit_Of_Measure"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_UniMeas', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Unit_Of_Measure_del"
        C_monodesc_mtnc.show 1
    Case "Value_Type"
        gut_Param.Str4 = "EXEC Value_Type_del"
        gut_Param.Str6 = gs_TableCode2
        gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Value_Type', '"
        ' these requetes fill the two list in maintenace screen
        gut_Param.Str8 = "EXEC Value_Type_Link_cbo "
        gut_Param.Str9 = "EXEC Value_Type_Link_cbo2 "
        ' the key of the table Criteria choice is an integer
        gut_Param.Str11 = "Integer"
        FillEmpty_Mtnc.show 1
    Case "Viewer"
        Viewer_mtnc.show 1
    Case "Visible_On"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Visible_On'"
        gs_ParamReqDel = "EXEC Media_Displays_del"
        C_SimpleDesc_mtnc.show 1
    Case "Problems_ToSolve"
        Grid.Col = 1
        If Grid.Text = "Y" Then
            Grid.Col = 0
            lst_ForDelete.AddItem Grid.Text
            Grid.RemoveItem Grid.Row
            gb_Return = OK
        Else
            SendMessage 69, "You aren't allowed to delete such a message.", gut_LangLogin.Code
        End If
    Case "Quot_LoseReason"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_LoseReason' , '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Quot_LoseReason_del "
        C_monodesc_mtnc.show 1
    Case "Quot_Comment"
        gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QuotComm',"
        gs_ParamReqDel = "EXEC Quot_Comment_del "
        C_Memo.show 1
    Case "DGrid_MainRunner"
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_MainRunner', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DGrid_MainRunner_del"
        C_categdesc_mtnc.show 1
    Case "DGrid_CrossTee"
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_CrossTee', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DGrid_CrossTee_del"
        C_categdesc_mtnc.show 1
    Case "DGrid_Interface"
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_Interface', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DGrid_Interface_del"
        C_categdesc_mtnc.show 1
    Case "DGrid_Group"
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_DGrid_Group', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC DGrid_Group_del"
        C_categdesc_mtnc.show 1
    Case "ProductsFamilies_Group"
        PF_mtnc.show 1
    Case "AccProductsFamilies_Group"
        PF_mtnc.show 1
    Case "Ceiling_InternetGroup"
        gs_ParamReqCsts = "EXEC Screen_Csts 'm_Ceil_IntGroup', '" & gut_LangLogin.Code & "'"
        gs_ParamReqDel = "EXEC Ceiling_InternetGroup_del"
        C_categdesc_mtnc.show 1
    End Select
    If gb_Return Then FillGrid3
End If
MouseOn
Exit Sub

suite:
Select Case Err
Case 30015
    If pic_next25.Visible Then
        pic_next25_Click
    Else
        Unload Me
    End If
Case Else
    StdError
    MouseOn
End Select
End Sub
Private Sub pic_log_Click()
 
Dim i As Integer

On Error GoTo suite

MouseOff
For i = 0 To 29
    gs_GridColumn2(i, 1) = i
Next i
If Grid2.HighLight = flexHighlightNever Then
    gs_TableCode = ""
    gs_TableCode2 = ""
    gs_TableCode3 = ""
    gs_TableCode4 = ""
    gs_TableCode5 = ""
    gs_TableCode6 = ""
    gs_TableCode7 = ""
    gs_TableCode8 = ""
    gs_TableCode9 = ""
    gs_TableCode10 = ""
    gs_TableCode11 = ""
    gs_TableCode12 = ""
    gs_TableCode13 = ""
End If
Select Case gs_TableName
Case "BI_Marketing"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_BI_Marketing', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC BI_Marketing_a_lst '" & QuoteParam(gs_TableCode) & "', '" & gs_CGCode & "', '" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1000
    gi_GridWidth2(1) = 1000
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 1000
    gi_GridWidth2(4) = 3620
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1000
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Base_Material"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Basemat', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Base_Material_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Categories"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Categories', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Categories_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 2000
    gi_GridWidth2(6) = 1000
    gi_GridWidth2(7) = 1000
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "Claim_Contact"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Claim_Cont', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Claim_Contact_a_lst " & gs_TableCode & ", '" & gut_LangLogin.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Claim_Contact_a_lst 0, '" & gut_LangLogin.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 1500
    gi_GridWidth2(4) = 1500
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1000
    gi_GridWidth2(7) = 1200
    gi_GridWidth2(8) = 1200
    For i = 9 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 9
Case "Claim_Coordinator"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_ClaCoord', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Claim_Coordinator_a_lst " & gs_TableCode & ", '" & gut_LangLogin.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Claim_Coordinator_a_lst 0, '" & gut_LangLogin.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 2000
    gi_GridWidth2(7) = 1200
    gi_GridWidth2(8) = 1200
    For i = 9 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 9
Case "Claim_Letter"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_letclai', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Claim_Letter_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Claim_Letter_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 1200
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Claim_Nature"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_natclai', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Claim_Nature_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Claim_Nature_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Claim_Recommendation"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Clairec', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Claim_Recommendation_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Claim_Recommendation_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Company_Activity"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Company_ac', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Company_Activity_Audit_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Company_Activity_Audit_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Offer_Type"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Offer_Type', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Offer_Type_Audit_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Offer_Type_Audit_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Offer_Internet"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Offer_Int ','" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Offer_Internet_Audit_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Offer_Internet_Audit_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 1200
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7

Case "Colours"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Colours', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Colours_a_lst '" & gs_TableCode & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 1200
    gi_GridWidth2(4) = 2500
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 1200
    gi_GridWidth2(7) = 1
    gi_GridWidth2(8) = 1
    gi_GridWidth2(9) = 1
    gi_GridWidth2(10) = 1200
    gi_GridWidth2(11) = 1200
    For i = 12 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 12
Case "Countries"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Country', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Countries_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1000
    gi_GridWidth2(2) = 1180
    gi_GridWidth2(3) = 600
    gi_GridWidth2(4) = 1540
    gi_GridWidth2(5) = 1540
    gi_GridWidth2(6) = 1200
    gi_GridWidth2(7) = 1200
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "Country_Link"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_CountryLink', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Country_Link_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1000
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 3000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Criteria_Choice"
   gs_Param2Req1 = "EXEC Screen_Csts 'aud_CritChoice', '" & gut_LangLogin.Code & "'"
    If gs_TableCode <> "" Then
        gs_Param2Req2 = "EXEC Criteria_Choice_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Criteria_Choice_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 3000
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Criteria_List"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_CritList', '" & gut_LangLogin.Code & "'"
    If gs_TableCode <> "" Then
        gs_Param2Req2 = "EXEC Criteria_List_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Criteria_List_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 2000
    gi_GridWidth2(6) = 1200
    gi_GridWidth2(7) = 1200
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "Currencies"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Currenc', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Currencies_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1700
    gi_GridWidth2(3) = 800
    gi_GridWidth2(4) = 3850
    For i = 5 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 5
Case "Customer"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Customer', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Customer_a_lst '" & prg.LoginName & "','" & QuoteParam(gs_TableCode) & "','" & QuoteParam(gs_TableCode7) & "','" & gut_LangWork.Code & "'"
    For i = 0 To 29
        gi_GridWidth2(i) = 1500
    Next i
    gi_GridNbColumns = 30
Case "DC_UOM":
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_DC_UOM', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC DC_UOM_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1700
    gi_GridWidth2(3) = 800
    For i = 4 To 21
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "DC_Equipement":
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_DC_Equipement', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC DC_Equipement_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1700
    gi_GridWidth2(3) = 3500
    For i = 4 To 21
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "DC_Carrier":
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_DC_Carrier', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC DC_Carrier_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1700
    gi_GridWidth2(3) = 800
    gi_GridWidth2(4) = 2500
    gi_GridWidth2(5) = 2500
    gi_GridWidth2(6) = 1700
    gi_GridWidth2(7) = 1200
    gi_GridWidth2(8) = 1200
    gi_GridWidth2(9) = 800
    
    For i = 10 To 21
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 10
Case "DC_Calendar":
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_DC_Calendar', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC DC_Max_Activity_a_lst '" & FormatD(gs_TableCode, "mm/dd/yyyy") & "', '" & DC_Choice2.cbo_month & "', '" & DC_Choice2.cbo_year & "', '" & DC_Choice2.cbo_Ship_DC_code.List(DC_Choice2.cbo_Ship_DC.ListIndex) & "'"
    gi_GridWidth2(0) = 1100
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1700
    gi_GridWidth2(3) = 1100
    gi_GridWidth2(4) = 1100
    gi_GridWidth2(5) = 800
    gi_GridWidth2(6) = 800
    gi_GridWidth2(7) = 800
    gi_GridWidth2(8) = 800
    For i = 9 To 21
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 9
Case "DC_Containers":
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_DC_Containers', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC DC_Containers_a_lst " & gs_TableCode & ", '" & FormatD(DC_Choice.txt_ShipDate, "mm/dd/yyyy") & "', '" & DC_Choice.cbo_ShipDC_code.List(DC_Choice.cbo_ShipDC.ListIndex) & "'"
    Else
        gs_Param2Req2 = "EXEC DC_Containers_a_lst 0, '" & FormatD(DC_Choice.txt_ShipDate, "mm/dd/yyyy") & "', '" & DC_Choice.cbo_ShipDC_code.List(DC_Choice.cbo_ShipDC.ListIndex) & "'"
    End If
    gi_GridWidth2(0) = 1100
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1700
    gi_GridWidth2(3) = 1200
    gi_GridWidth2(4) = 1100
    For i = 5 To 26
        gi_GridWidth2(i) = 1200
    Next i
    For i = 27 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 27
Case "Definition"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Definition', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Definition_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Dist_Centre"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Dist_Ctr', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Dist_Centre_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    For i = 0 To 18
        gi_GridWidth2(i) = 1500
    Next i
    For i = 19 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 19
End Select

pic_log_click2

Exit Sub

suite:
StdError
End Sub

Sub pic_log_click2()
Dim i As Integer
On Error GoTo suite

Select Case gs_TableName

Case "Estimate_GridType"
    If gs_CGCode = "C002" Then
    gs_Param2Req1 = "EXEC Screen_Csts 'a_EstType', '" & gut_LangLogin.Code & "'"
    Else
        gs_Param2Req1 = "EXEC Screen_Csts 'a_EstType4', '" & gut_LangLogin.Code & "'"
    End If
    gs_Param2Req2 = "EXEC Estimate_GridType_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Estimate_Length"
    gs_Param2Req1 = "EXEC Screen_Csts 'a_EstLength', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Estimate_Length_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Estimate_Slot"
    gs_Param2Req1 = "EXEC Screen_Csts 'a_EstSlot', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Estimate_Slot_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Budgeted_Exchange_Rates"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_ExRatBu', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Budgeted_Exchange_Rates_a_lst '" & QuoteParam(gs_TableCode) & "', '" & QuoteParam(gs_TableCode3) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1000
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 1670
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 2000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Exchange_Rates"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_ExRatOf', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Exchange_Rates_a_lst '" & QuoteParam(gs_TableCode) & "', '" & QuoteParam(gs_TableCode3) & "', '" & QuoteParam(gs_TableCode4) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1000
    gi_GridWidth2(1) = 1000
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 1650
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 2000
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "File_Extension"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_File_Ext', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_File_Ext_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 1500
    gi_GridWidth2(4) = 1500
    gi_GridWidth2(5) = 1500
    gi_GridWidth2(6) = 1500
    gi_GridWidth2(7) = 1500
    gi_GridWidth2(8) = 1500
    gi_GridWidth2(9) = 1500
    gi_GridWidth2(10) = 1500
    gi_GridWidth2(11) = 1500
    For i = 12 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 12
Case "Geographic_Markets"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Geo_Markets', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Geographic_Markets_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1000
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Glossary"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Glossary', '" & gut_LangLogin.Code & "'"
    If gs_TableCode = "" Then
        gs_TableCode = 0
    End If
    gs_Param2Req2 = "EXEC Glossary_a_lst '" & QuoteParam(gs_TableCode) & "', '" & QuoteParam(gs_TableCode2) & "', '" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 3000
    gi_GridWidth2(4) = 3000
    gi_GridWidth2(5) = 3000
    gi_GridWidth2(6) = 1200
    gi_GridWidth2(7) = 1200
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "Hyper_Base_Material"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_HyperBM', '" & gut_LangLogin.Code & "'"
    If gs_TableCode = "" Then
        gs_Param2Req2 = "EXEC Hyper_Base_Material_a_lst 0, '', '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Hyper_Base_Material_a_lst " & gs_TableCode & ", '" & gs_TableCode4 & "', '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 3000
    gi_GridWidth2(4) = 3000
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 1200
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Internet_Area"
    gs_Param2Req1 = "EXEC Screen_Csts 'Aud_Int_Area', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Internet_area_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Media_Interest"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Interest', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Interest_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Logistic_Markets"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Log_Markets', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Logistic_Markets_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1000
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Sales_Markets"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Sales_Markets', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Sales_Market_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 2000
    gi_GridWidth2(6) = 1000
    gi_GridWidth2(7) = 1000
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "Market_Objectives"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Objectives', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Market_Objectives_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Market_Segmentation"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Markseg', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Market_Segmentation_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 3000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Measurement_System"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Measyst', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Measurement_System_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1700
    gi_GridWidth2(3) = 600
    gi_GridWidth2(4) = 3620
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1500
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
'Case "Grid", "Grid_Value"
'    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Grid', '" & gut_LangLogin.Code & "'"
'    If gs_TableCode <> "" Then
'        gs_Param2Req2 = "EXEC Grid_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
'    Else
'        gs_Param2Req2 = "EXEC Grid_a_lst 0, '" & gut_LangWork.Code & "'"
'    End If
'    gi_GridWidth2(0) = 1200
'    gi_GridWidth2(1) = 1200
'    gi_GridWidth2(2) = 1200
'    gi_GridWidth2(3) = 3000
'    gi_GridWidth2(4) = 3000
'    gi_GridWidth2(5) = 1000
'    gi_GridWidth2(6) = 1500
'    For i = 7 To 29
'        gi_GridWidth2(i) = 1
'    Next i
'    gi_GridNbColumns = 7
Case "Grid_Description"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Grid_Desc', '" & gut_LangLogin.Code & "'"
    If gs_TableCode = "" Then
        gs_TableCode = "0"
    End If
    gs_Param2Req2 = "EXEC Grid_Description_a_lst " & QuoteParam(gs_TableCode) & ",'" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    gi_GridWidth2(4) = 1500
    gi_GridWidth2(5) = 1500
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Grid_Manufacturer"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Grid_Man', '" & gut_LangLogin.Code & "'"
    If gs_TableCode = "" Then
        gs_TableCode = "0"
    End If
    gs_Param2Req2 = "EXEC Grid_Manufacturer_a_lst " & QuoteParam(gs_TableCode) & ",'" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    gi_GridWidth2(4) = 1500
    gi_GridWidth2(5) = 1500
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Grid_Type"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Grid_Type', '" & gut_LangLogin.Code & "'"
    If gs_TableCode = "" Then
        gs_TableCode = "0"
    End If
    gs_Param2Req2 = "EXEC Grid_Type_a_lst " & QuoteParam(gs_TableCode) & ",'" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 2500
    gi_GridWidth2(5) = 1500
    gi_GridWidth2(6) = 1500
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Media_Type"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Media_Type', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Type_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Owner"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Owner', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "SELECT AOWN_datetime, AOWN_user, AOWN_transaction_type, AOWN_desc " _
            & "FROM Audit_Owner " _
            & "WHERE AOWN_code = '" & QuoteParam(gs_TableCode) & "'" _
            & "ORDER BY AOWN_datetime desc, AOWN_user, AOWN_transaction_type"
    Else
        gs_Param2Req2 = "SELECT AOWN_datetime, AOWN_user, AOWN_transaction_type, AOWN_desc " _
            & "FROM Audit_Owner " _
            & "ORDER BY AOWN_datetime desc, AOWN_user, AOWN_transaction_type"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Pattern_Group"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_PatGroup', '" & gut_LangLogin.Code & "'"
    If gs_TableCode = "" Then
        gs_TableCode = "0"
    End If
    gs_Param2Req2 = "EXEC Pattern_Group_a_lst " & QuoteParam(gs_TableCode) & ",'" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 2500
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1500
    gi_GridWidth2(5) = 1500
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Plants"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Plants', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Plants_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    For i = 0 To 17
        gi_GridWidth2(i) = 1500
    Next i
    For i = 18 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 18
Case "Possible_Area_Comb"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Poss_Area', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Possible_Area_Comb_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 3000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Priv_Labels"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_PrivLab', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Priv_Labels_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 1000
    gi_GridWidth2(4) = 2500
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1000
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Product_Combine"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_ProdComb', '" & gut_LangLogin.Code & "'"
    If gs_TableCode = "" Then
        gs_TableCode = "0"
    End If
    gs_Param2Req2 = "EXEC Product_Combine_a_lst " & QuoteParam(gs_TableCode) & ", '" & gs_TableCode4 & "', '" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 2500
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 2500
    gi_GridWidth2(5) = 1500
    gi_GridWidth2(6) = 1500
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Product_Dimension"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_proddim', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Product_Dimension_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1100
    gi_GridWidth2(1) = 1100
    gi_GridWidth2(2) = 1100
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1100
    gi_GridWidth2(7) = 1100
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "Product_Height"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Height', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Product_Height_a_lst '" & QuoteParam(gs_TableCode) & "', '" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1500
    gi_GridWidth2(5) = 1500
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Product_Module"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_ProdMod', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Product_Module_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1100
    gi_GridWidth2(1) = 1100
    gi_GridWidth2(2) = 1100
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1100
    gi_GridWidth2(5) = 1100
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Products_Edges", "Products_Groups"
    If gs_TableName = "Products_Groups" Then
        gs_Param2Req1 = "EXEC Screen_Csts 'aud_Group', '" & gut_LangLogin.Code & "'"
    Else
        gs_Param2Req1 = "EXEC Screen_Csts 'aud_Edge', '" & gut_LangLogin.Code & "'"
    End If
    gs_Param2Req2 = "EXEC Products_Edges_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Products_Families"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Family', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Products_Families_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Products_Patterns"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Pattern', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Products_Patterns_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Products_Segmentation"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Segment', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Products_Segmentation_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Media_Quality_On_Screen"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Quality', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Quality_On_Screen_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Recommended_Area"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Rec_Area', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Recommended_Area_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 3000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Sales_Offices"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Sales_Off', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Sales_Office_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    For i = 0 To 16
        gi_GridWidth2(i) = 1500
    Next i
    For i = 17 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 17
Case "Int_Stract_Region"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Stract_Reg', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Int_Stract_Region_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    For i = 0 To 16
        gi_GridWidth2(i) = 1500
    Next i
    For i = 17 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 17
Case "Sales_Reps_Assignement"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_SalRepa', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Sales_Reps_Assignement_a_lst '" & gs_TableCode & "','" & gs_TableCode3 & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1000
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 1800
    gi_GridWidth2(4) = 1800
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1000
    gi_GridWidth2(7) = 3000
    gi_GridWidth2(8) = 1200
    gi_GridWidth2(9) = 1200
    For i = 10 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 10
Case "Sales_Reps"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_SalReps', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Sales_Reps_a_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1000
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 600
    gi_GridWidth2(4) = 2500
    gi_GridWidth2(5) = 1850
    gi_GridWidth2(6) = 1850
    gi_GridWidth2(7) = 1850
    gi_GridWidth2(8) = 2000
    gi_GridWidth2(9) = 1000
    gi_GridWidth2(10) = 1000
    For i = 11 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 11
Case "Shapes"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Shape', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Shapes_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Form"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Form', '" & gut_LangLogin.Code & "'"    ' JN reuse screen constants from Shape
    gs_Param2Req2 = "EXEC Form_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 700
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Perforation_Shape"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Perforation_Shape', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Perforation_Shape_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 700
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Perforation"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Perforation', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Perforation_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 900     ' Z_DATETIME
    gi_GridWidth2(1) = 1000     ' Z_user
    gi_GridWidth2(2) = 900     ' Z_transaction_type
    gi_GridWidth2(3) = 1500     ' PRF_desc
    gi_GridWidth2(4) = 500      ' internet_flag
    gi_GridWidth2(5) = 900     ' drop_date
    gi_GridWidth2(6) = 500      ' PRF_Order
    gi_GridWidth2(7) = 500      ' PRF_DIMM1
    gi_GridWidth2(8) = 500      ' PRF_UOM1
    gi_GridWidth2(9) = 500      ' PRF_DIMM2
    gi_GridWidth2(10) = 500     ' PRF_UOM2
    gi_GridWidth2(11) = 500     ' PRF_DIMM3
    gi_GridWidth2(12) = 500     ' PRF_UOM3
    gi_GridWidth2(13) = 500     ' PRF_DIMM4
    gi_GridWidth2(14) = 500     ' PRF_UOM4
    gi_GridWidth2(15) = 500     ' PRF_OpenArea
    gi_GridWidth2(16) = 1000    ' PRF_Design
    gi_GridWidth2(17) = 1000    ' PRFSH_Desc
    For i = 18 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 18
Case "Component_Type"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Component_Type', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Component_Type_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 700
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Super_Base_Material"
    ' this requete get the labels of the columns of grid in the audit screen
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_SupBaseMat', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Super_Base_Material_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    ' These Lignes define the with of each columns in the audit screen
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1000
    ' The others columns are hide by using a with of one unit
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Super_Categories"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_SupCate', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Super_Categories_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1700
    gi_GridWidth2(3) = 600
    gi_GridWidth2(4) = 3620
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1500
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Source_Type"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Source_Type', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Area_Type_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Suppliers"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Supplie', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Suppliers_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1000
    gi_GridWidth2(1) = 1000
    gi_GridWidth2(2) = 1000
    gi_GridWidth2(3) = 800
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 2000
    gi_GridWidth2(7) = 2000
    gi_GridWidth2(8) = 2000
    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
    For i = 18 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 18
Case "Support"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Support', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Source_Support_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    gi_GridWidth2(4) = 1
    For i = 5 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 5
Case "Surfaces"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Surface', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Surfaces_a_lst '" & QuoteParam(gs_TableCode) & "','" & gs_CGCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Tech"
    gs_Param2Req1 = gut_Param.Str9
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Tech_" & gut_Param.Str1 & "_a_lst " _
            & gs_TableCode3 & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Tech_" & gut_Param.Str1 & "_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    Select Case gut_Param.Str1
    Case "FireReac", "FireRes", "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
        gi_GridWidth2(3) = 1200
    Case Else
        gi_GridWidth2(3) = 1
    End Select
    gi_GridWidth2(4) = 1200
    Select Case gut_Param.Str1
    Case "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Density", "Humidity", "Light", "Thermal", "Weight", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
        gi_GridWidth2(5) = 1200
    Case Else
        gi_GridWidth2(5) = 1
    End Select
    gi_GridWidth2(6) = 1200
    gi_GridWidth2(7) = 1200
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "Tech_Value_Curve"
    gs_Param2Req1 = gut_Param.Str24
    If Grid2.HighLight = flexHighlightAlways Then
         gs_Param2Req2 = "EXEC Tech_Value_Curve_a_lst " & _
         gut_Param.Str25 & ", " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Tech_Value_Curve_a_lst " & gut_Param.Str25 & ", 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1000
    gi_GridWidth2(1) = 1000
    gi_GridWidth2(2) = 1000
    gi_GridWidth2(3) = 3400
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Tech_Value_Option"
    gs_Param2Req1 = gut_Param.Str19
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Tech_" & gut_Param.Str21 & "_Option_a_lst " _
            & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Tech_" & gut_Param.Str21 & "_Option_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2600
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Territories"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Territo', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Territories_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 600
    gi_GridWidth2(4) = 2300
    gi_GridWidth2(5) = 2400
    gi_GridWidth2(6) = 1800
    gi_GridWidth2(7) = 1200
    gi_GridWidth2(8) = 1200
    For i = 9 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 9
Case "Test_Category"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Test_Categ', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_Category_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_Category_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Test_House"
     gs_Param2Req1 = "EXEC Screen_Csts 'aud_Test_House', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_House_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_House_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 2000
    gi_GridWidth2(6) = 2000
    gi_GridWidth2(7) = 1000
    gi_GridWidth2(8) = 1500
    gi_GridWidth2(9) = 1500
    gi_GridWidth2(10) = 900
    gi_GridWidth2(11) = 900
    gi_GridWidth2(12) = 900
    gi_GridWidth2(13) = 1000
    For i = 14 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 14
Case "Test_Market"
   gs_Param2Req1 = "EXEC Screen_Csts 'aud_Test_Mark', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_Market_a_lst " & gs_TableCode3 & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_Market_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 2000
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Test_Standard"
   gs_Param2Req1 = "EXEC Screen_Csts 'aud_Test_Stand', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        '/* debut modif */
        gs_Param2Req2 = "EXEC Test_Standard_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
        '/* end modif */
    Else
        gs_Param2Req2 = "EXEC Test_Standard_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 1200
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Test_Type"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Test_Type', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_Type_a_lst " & gs_TableCode3 & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_Type_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 1200
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Test_Typ_Condition"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Tst_TypCnd', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_Typ_Condition_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_Typ_Condition_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1200
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Test_Dtl_Condition"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Tst_DtlCnd', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_Dtl_Condition_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_Dtl_Condition_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 1200
    gi_GridWidth2(6) = 1200
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Test_Dtl_Result"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Tst_Dtlrsl', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_Dtl_Result_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_Dtl_Result_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 1200
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 2000
    gi_GridWidth2(6) = 1200
    gi_GridWidth2(7) = 1200
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8

Case "Test_Link_Products"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_link_prod', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_Link_Products_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_Link_Products_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 1200
    gi_GridWidth2(4) = 1200
    gi_GridWidth2(5) = 2000
    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) = 2000
    gi_GridWidth2(14) = 1200
    gi_GridWidth2(15) = 1200
    For i = 16 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 16

Case "Type_Of_Memo"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Memo_Type', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Type_Of_Memo_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Type_Of_View"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Media_Type_Of_View', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Type_Of_View_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Unit_Of_Measure"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_UniMeas', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Unit_Of_Measure_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 600
    gi_GridWidth2(4) = 3620
    gi_GridWidth2(5) = 1000
    gi_GridWidth2(6) = 1500
    For i = 7 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 7
Case "Value_Type"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_CritList', '" & gut_LangLogin.Code & "'"
    If gs_TableCode <> "" Then
        gs_Param2Req2 = "EXEC Value_Type_a_lst " & gs_TableCode & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Value_Type_a_lst 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 2000
    gi_GridWidth2(6) = 1200
    gi_GridWidth2(7) = 1200
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "Viewer"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Viewer', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC media_Viewer_a_lst '" & QuoteParam(gs_TableCode) & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 2500
    For i = 5 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 5
Case "Visible_On"
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_Visible_On', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Media_Displays_a_lst '" & QuoteParam(gs_TableCode) & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 5000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "Problems_ToSolve"
   gs_Param2Req1 = "EXEC Screen_Csts pb_solved, '" & gut_LangLogin.Code & "'"
   gs_Param2Req2 = "EXEC Problems_Solved_lst '" & QuoteParam(prg.LoginName) & "','" & QuoteParam(gs_TableCode7) & "'"
   gi_GridWidth2(0) = 1000
   gi_GridWidth2(1) = 1200
   gi_GridWidth2(2) = 8000
   gi_GridWidth2(3) = 1200
   For i = 4 To 29
      gi_GridWidth2(i) = 1
   Next i
   gi_GridNbColumns = 6
   gs_TableCode7 = ""
Case "Test_House_Acred"
     gs_Param2Req1 = "EXEC Screen_Csts 'aud_Test_THOA', '" & gut_LangLogin.Code & "'"
    If Grid2.HighLight = flexHighlightAlways Then
        gs_Param2Req2 = "EXEC Test_House_Acred_a_lst " & gs_TableCode & ", " & gs_TableCode2 & ", '" & gut_LangWork.Code & "'"
    Else
        gs_Param2Req2 = "EXEC Test_House_Acred_a_lst 0, 0, '" & gut_LangWork.Code & "'"
    End If
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2000
    gi_GridWidth2(4) = 2000
    gi_GridWidth2(5) = 2000
    gi_GridWidth2(6) = 1500
    gi_GridWidth2(7) = 1500
    For i = 8 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 8
Case "DGrid_MainRunner"
    gs_Param2Req1 = "EXEC Screen_Csts 'Aud_MainRunner', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Audit_DGrid_MainRunner_t_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "DGrid_CrossTee"
    gs_Param2Req1 = "EXEC Screen_Csts 'Aud_CrossTee', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Audit_DGrid_CrossTee_t_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "DGrid_Interface"
    gs_Param2Req1 = "EXEC Screen_Csts 'Aud_Interface', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Audit_DGrid_Interface_t_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "DGrid_Group"
    gs_Param2Req1 = "EXEC Screen_Csts 'Aud_DGrid_Group', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Audit_DGrid_Group_t_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "Ceiling_InternetGroup"
    gs_Param2Req1 = "EXEC Screen_Csts 'Aud_CeiIntGroup', '" & gut_LangLogin.Code & "'"
    gs_Param2Req2 = "EXEC Audit_Ceiling_InternetGroup_t_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "'"
    gi_GridWidth2(0) = 1200
    gi_GridWidth2(1) = 1200
    gi_GridWidth2(2) = 1200
    gi_GridWidth2(3) = 2500
    gi_GridWidth2(4) = 1000
    gi_GridWidth2(5) = 1000
    For i = 6 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 6
Case "ProductsFamilies_Group"
    'constantes de l'ecran d'audit
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_FamilyGroup', '" & gut_LangLogin.Code & "'"
    'liste de la table d'audit, prenant en compte la categorie dans le cas d'un audit global
    gs_Param2Req2 = "EXEC Audit_ProductsFamilies_Group_t_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "','C002'"
    gi_GridWidth2(0) = 1500
    gi_GridWidth2(1) = 1500
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 3000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
Case "AccProductsFamilies_Group"
    'constantes de l'ecran d'audit
    gs_Param2Req1 = "EXEC Screen_Csts 'aud_AFamGroup', '" & gut_LangLogin.Code & "'"
    'liste de la table d'audit, prenant en compte la categorie dans le cas d'un audit global
    gs_Param2Req2 = "EXEC Audit_ProductsFamilies_Group_t_lst '" & gs_TableCode & "','" & gut_LangWork.Code & "','C004'"
    gi_GridWidth2(0) = 1500
    gi_GridWidth2(1) = 1500
    gi_GridWidth2(2) = 1500
    gi_GridWidth2(3) = 3000
    For i = 4 To 29
        gi_GridWidth2(i) = 1
    Next i
    gi_GridNbColumns = 4
End Select
C_audit.show 1
MouseOn
Exit Sub

suite:
StdError
End Sub

Private Sub pic_Order_Click()

MouseOff
C_Order.show 1
MouseOn

End Sub

Private Sub pic_print_Click()

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 pic_next25.Visible Then
        ' The list is not fully loaded
        FillAll
        FillGrid3
   '  pic_next25.Visible = KO
    End If
' this code define the width of each colmuns in the print report
Select Case gs_TableName
        ' REMOVED 7.11.2005 JULO
'Case "Area_Manager"
'    PrintGrid 1, 10, Array(0, 33, 0, 33, 0, 33, 0, 33, 0, 33, 0, 33, 0, 33, 33)
Case "Base_Material"
    PrintGrid 1, 15, Array(0, 0, 50, 20, 20)
Case "BI_Marketing"
    PrintGrid 1, 15, Array(15, 0, 50, 15, 20)
Case "Categories"
    PrintGrid 2, 28, Array(0, 0, 65, 0, 65, 0, 65, 30, 30)
Case "Claim_Contact"
    PrintGrid 2, 10, Array(0, 30, 30, 20, 20, 15, 15)
Case "Claim_Coordinator"
    PrintGrid 2, 28, Array(0, 40, 20, 20, 20, 20)
Case "Claim_Letter"
    PrintGrid 1, 10, Array(0, 0, 0, 35, 35, 15, 15)
Case "Claim_Nature"
    PrintGrid 1, 10, Array(0, 0, 60, 15, 15)
Case "Claim_Recommendation"
    PrintGrid 1, 10, Array(0, 0, 60, 15, 15)
Case "Claim_Report1"
    PrintGrid 2, 10, Array(20, 10, 20, 20, 20, 20, 15, 15)
Case "Claim_Report2"
'    PrintGrid 2, 10, Array(30, 10, 20, 20, 20, 20, 20, 20, 20, 20, 20, 30, 15)
    PrintGridWithTotal 2, 10, Array(30, 10, 20, 20, 20, 20, 20, 20, 20, 20, 20, 30, 15), Array(30, 10, 20, 20, 20, 20, 20, 20, 20, 20, 20, 30, 15)

Case "Claim_Report3"
    PrintGrid 2, 10, Array(20, 15, 20, 50, 20, 20, 20, 40, 20, 20, 20, 20, 30, 20, 20, 20, 20)
Case "Claim_Report4"
   ' PrintGrid 2, 10, Array(20, 20, 20, 20, 20, 20, 20, 80, 20, 40, 40, 40, 30, 40, 30, 40, 20, 20, 20, 20, 20, 20, 40)
    PrintGridWithTotal 2, 10, Array(20, 20, 20, 20, 20, 20, 20, 80, 20, 40, 40, 40, 30, 40, 30, 40, 20, 20, 20, 20, 20, 20, 0), Array(20, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20, 20, 20, 0, 0)
Case "Claim_Report5"
    PrintGrid 2, 10, Array(15, 15, 22, 22, 22, 22, 22)
'Case "Converting"
'    PrintGrid 1, 10, Array(50, 50)
Case "Colours"
    PrintGrid 1, 10, Array(0, 45, 15, 15, 0, 0, 0, 0, 10, 15)
Case "Company Activity"
     PrintGrid 1, 10, Array(0, 0, 0, 35, 40, 10, 0, 15)
Case "Offer Type"
     PrintGrid 1, 10, Array(0, 0, 0, 35, 40, 10, 0, 15)
Case "Offer_Internet"
    PrintGrid 1, 10, Array(0, 0, 70, 15, 15)
Case "Countries"
    PrintGrid 1, 10, Array(0, 0, 50, 0, 20, 15, 15)
Case "Criteria_Choice"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "Criteria_List"
    PrintGrid 1, 10, Array(0, 0, 0, 50, 0, 50, 50, 25, 25)
Case "Currencies"
    PrintGrid 1, 16, Array(15, 85)
Case "Customer"
    PrintGrid 1, 20, Array(20, 50, 30, 50, 50)
Case "DC_Calendar"
    PrintGrid 2, 25, Array(30, 0, 28, 28, 28, 28)
Case "DC_Interco"
    Debug.Assert (False)
Case "DC_Customer"
    Debug.Assert (False)
Case "DC_Containers"
    DCLoadPrint
Case "DC_Receipts"
    Debug.Assert (False)
Case "DC_Work"
    PrintGrid 2, 12, Array(30, 14, 14, 14, 14, 14, 14, 14, 14)
Case "DC_UOM"
    PrintGrid 1, 20, Array(90)
Case "DC_Equipement"
    PrintGrid 1, 20, Array(90)
Case "DC_Carrier"
    PrintGrid 2, 20, Array(30, 0, 40, 40, 30)
Case "Definition"
    PrintGrid 1, 15, Array(0, 100)
Case "Dist_Centre"
    PrintGrid2 16, Array(70, 70, 70, 70, 70, 70, 70), Array(0, 1, 2, 3, 4, 5, 6)
Case "Budgeted_Exchange_Rates"
    PrintGrid 1, 8, Array(0, 20, 20, 20)
Case "Exchange_Rates"
    PrintGrid 1, 8, Array(0, 20, 20, 20, 20)
Case "File_Extension"
    PrintGrid 1, 15, Array(0, 25, 25, 25, 25)
Case "Geographic_Markets"
    PrintGrid 1, 16, Array(0, 0, 100, 70, 150, 15)
Case "Glossary"
    PrintGrid 2, 10, Array(30, 30, 55, 0, 15, 15)
Case "Grid"
    PrintGrid 1, 10, Array(0, 0, 0, 30, 0, 30, 0, 30, 5, 5)
Case "Grid_Description"
    PrintGrid 1, 15, Array(0, 0, 60, 15, 15)
Case "Grid_Manufacturer"
    PrintGrid 1, 15, Array(0, 0, 60, 15, 15)
Case "Grid_Type"
    PrintGrid 1, 15, Array(0, 0, 30, 0, 30, 15, 15)
Case "Internet_Area"
    PrintGrid 1, 15, Array(6, 0, 100, 0, 15, 15)
Case "Logistic_Markets"
    PrintGrid 1, 16, Array(0, 0, 100, 70, 15, 15)
Case "Media_Interest"
    PrintGrid 1, 15, Array(0, 100)
Case "Media_Quality_On_Screen"
    PrintGrid 1, 15, Array(0, 100)
Case "Market_Segmentation"
    PrintGrid 1, 10, Array(0, 0, 60)
Case "Market_Objectives"
    PrintGrid 1, 15, Array(0, 100)
Case "Measurement_System"
    PrintGrid 1, 10, Array(10, 0, 60, 15, 15)
Case "Media_Type"
    PrintGrid 1, 15, Array(0, 100)
'Case "Media_Short_Classif"                 ' task409 JN
'    Media_Short_Classif_CMain_Print
Case "Media_CountriesLanguage"
    PrintGrid 1, 15, Array(15, 50, 0, 15, 0)
Case "Owner"
    PrintGrid 1, 15, Array(0, 100)
Case "Quot_Comment"
    PrintGrid 1, 15, Array(0, 0, 70, 15, 15)
Case "Quot_LoseReason"
    PrintGrid 1, 15, Array(0, 0, 70, 15, 15)
Case "Pattern_Group"
    PrintGrid 1, 10, Array(0, 0, 70, 15, 15)
Case "Product_Combine"
    PrintGrid 1, 10, Array(0, 0, 50, 20, 15, 15)
Case "Plants"
    PrintGrid2 16, Array(70, 70, 70, 70, 70, 70, 70, 70), Array(0, 1, 2, 3, 4, 5, 6, 7)
Case "Possible_Area_Comb"
    PrintGrid 1, 8, Array(0, 0, 100)
Case "Priv_Labels"
    PrintGrid 1, 15, Array(0, 0, 70, 15, 15)
Case "Problems_ToSolve"
'    If pic_next25.Visible Then
 '       ' The list is not fully loaded
  '      FillAll
   '     FillGrid3
 '  '  pic_next25.Visible = KO
  '  End If
    PrintGridWordWarp 2, 10, Array(0, 0, 20, 0, 20, 105)
Case "Product_Dimension"
    PrintGrid 2, 10, Array(0, 0, 0, 20, 0, 10, 0, 20, 0, 20, 10, 20)
Case "Product_Height"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "Product_Module"
    PrintGrid 1, 15, Array(0, 0, 70, 15, 15)
Case "Products_Edges", "Products_Groups"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "Products_Families"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "Product_Height"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "Products_Patterns"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "Quot_Historic"
    PrintGrid 1, 10, Array(15, 10, 40, 35)
Case "Quot_MetalSystem", "Quot_MetalBorder", "Quot_MetalFinish", "Quot_MetalMaterial", "Quot_MetalGasket", "Quot_MetalPerforation", "Quot_MetalEdge", "Quot_MetalAcoustic"
    PrintGrid 1, 10, Array(0, 0, 100)
Case "Recommended_Area"
    PrintGrid 1, 10, Array(0, 0, 60)
Case "Sales_Offices", "Int_Stract_Region"
    PrintGrid2 16, Array(0, 70, 70, 70, 70, 70, 70, 70), Array(0, 1, 2, 3, 4, 5, 6, 7)
Case "Sales_Markets"
    PrintGrid 1, 16, Array(0, 0, 100, 45, 25, 15, 15)
Case "Sales_Reps_Assignement"
    PrintGrid 1, 12, Array(0, 50, 0, 50, 25, 25, 0, 0, 25, 25)
Case "Sales_Reps"
    PrintGrid 1, 16, Array(10, 90, 30, 30, 30, 0, 0, 25, 25)
Case "Shapes"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "Perforation"
    PrintGrid 1, 10, Array(0, 0, 12, 20, 10, 7, 8, 7, 8, 7, 0, 0, 0, 0, 9, 12)
Case "Perforation_Shape", "Component_Type"
    PrintGrid 1, 10, Array(10, 0, 50, 10, 20, 10)
Case "Form"
    PrintGrid 1, 10, Array(0, 0, 50, 10, 20, 20)
Case "Source_Type"
    PrintGrid 1, 15, Array(0, 100)
Case "Super_Base_Material"
    PrintGrid 1, 8, Array(0, 0, 0, 35, 35, 15, 15)
Case "Super_Categories"
    PrintGrid 1, 18, Array(15, 0, 85, 15, 20)
Case "Suppliers"
    PrintGrid2 20, Array(70, 70, 70, 70, 70, 70, 70), Array(0, 1, 2, 3, 4, 5, 6)
Case "Support"
    PrintGrid 1, 15, Array(0, 100)
Case "Surfaces"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "Tech"
    Select Case gut_Param.Str1
    Case "FireReac", "FireRes"
        PrintGrid 1, 5, Array(0, 30, 0, 0, 30, 0, 20, 20)
    Case "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Density", "Humidity", "Weight", "Thermal", "Light", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
        PrintGrid 2, 5, Array(0, 30, 0, 0, 30, 20, 25, 25)
    Case Else
        PrintGrid 1, 5, Array(0, 0, 0, 0, 40, 0, 30, 30)
    End Select
Case "Tech_Value"
    Select Case gut_Param.Str11
    Case "1"
        PrintGrid 2, 5, Array(0, 30, 0, 30, 0, 0, 30, 20, 20)
    Case "2"
        Select Case gut_Param.Str1
        Case "AcoustAW", "AcoustNRC", "AbsClass", "EquivSoundAbs"
            PrintGrid 2, 5, Array(0, 20, 0, 20, 0, 20, 0, 0, 20, 0, 20, 15, 15)
        Case Else
            PrintGrid 2, 5, Array(0, 25, 0, 25, 0, 25, 0, 0, 25, 15, 15)
        End Select
    Case "3"
        Select Case gut_Param.Str1
        Case "FireReac", "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "RedInd", "Rain"
            PrintGrid 2, 5, Array(0, 15, 0, 15, 0, 15, 0, 20, 0, 0, 20, 0, 15, 15, 15)
        Case Else
            PrintGrid 2, 5, Array(0, 20, 0, 20, 0, 20, 0, 20, 0, 0, 20, 15, 15)
        End Select
    Case "4"
        Select Case gut_Param.Str1
        Case "FireRes"
            PrintGrid 2, 5, Array(0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 0, 15, 0, 15, 15, 15)
        Case Else
            PrintGrid 2, 5, Array(0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 0, 15, 15, 15)
        End Select
    Case "5"
        PrintGrid 2, 5, Array(0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 0, 15, 15, 15)
    End Select
Case "Tech_Value_Curve"
        PrintGrid 1, 5, Array(0, 0, 60, 20, 20)
Case "Tech_Value_Option"
        PrintGrid 1, 5, Array(0, 0, 60, 20, 20)
Case "Territories"
    PrintGrid 1, 28, Array(20, 110, 0, 70, 35, 35)
Case "Test_Category"
    PrintGrid 1, 10, Array(0, 0, 75, 10, 15)
Case "Test_House"
    PrintGrid 1, 10, Array(0, 0, 30, 25, 20, 10, 15)
Case "Test_House_Acred"
    PrintGrid 2, 10, Array(0, 0, 0, 35, 40, 40, 15, 15)
Case "Test_Market"
    PrintGrid 1, 10, Array(0, 0, 0, 35, 40, 10, 15)
Case "Test_Standard"
    PrintGrid 1, 10, Array(0, 0, 35, 0, 40, 10, 15)
Case "Test_Type"
    PrintGrid 1, 10, Array(0, 35, 0, 0, 40, 10, 15)
Case "Test_Dtl_Condition"
    PrintGrid 1, 10, Array(0, 0, 0, 35, 40, 10, 0, 15)
Case "Test_Typ_Condition"
    PrintGrid 1, 10, Array(0, 0, 75, 10, 15)
Case "Test_Dtl_Result"
    PrintGrid 1, 10, Array(0, 0, 0, 45, 30, 10, 0, 15)
Case "TopBottomPage"
    PrintGridWordWarp 2, 10, Array(0, 0, 85, 0, 10, 0, 25, 0, 10, 0, 15)
Case "Type_Of_View"
    PrintGrid 1, 15, Array(0, 100)
Case "Type_Of_Memo"
    PrintGrid 1, 15, Array(0, 100)
Case "Unit_Of_Measure"
    PrintGrid 1, 8, Array(15, 0, 85, 15, 20)
Case "Value_Type"
    PrintGrid 2, 15, Array(0, 0, 0, 25, 0, 25, 50, 15, 15)
Case "Viewer"
    PrintGrid 1, 15, Array(0, 100)
Case "Visible_On"
    PrintGrid 1, 15, Array(0, 100)
Case "DGrid_MainRunner"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "DGrid_CrossTee"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "DGrid_Interface"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "DGrid_Group"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case "ProductsFamilies_Group"
    PrintGrid 2, 28, Array(0, 0, 0, 0, 40, 0, 40, 10, 10)
Case "AccProductsFamilies_Group"
    PrintGrid 2, 28, Array(0, 0, 0, 0, 40, 0, 40, 10, 10)
Case "PFG_Category"
    PrintGrid 2, 28, Array(0, 0, 0, 40, 0, 40, 10, 10)
Case "APFG_Category"
    PrintGrid 2, 28, Array(0, 0, 0, 40, 0, 40, 10, 10)
Case "MediaOnDroppedProducts"
    PrintGrid 1, 10, Array(30, 60)
Case "Ceiling_InternetGroup"
    PrintGrid 1, 10, Array(0, 0, 60, 20, 20)
Case Else
    PrintGrid 1, 10, Array(0, 0, 60, 0, 0, 20, 20)
End Select
MouseOn

End Sub
Private Sub pic_refresh_Click()

MouseOff
FillGrid
MouseOn

End Sub
Private Sub pic_search_Click()

MouseOff
gi_SearchGrid = 1
C_search.show 1
If Grid2.HighLight = flexHighlightNever Then
    DoEvents
    C_main.Grid_Click
End If
MouseOn

End Sub
Private Sub pic_upd_Click()

MouseOff
If Grid2.HighLight = flexHighlightNever Then
    SendMessage 1, "Please, first select a record.", gut_LangLogin.Code
Else
    gb_Return = KO
    If gut_LangWork.Code = "E" Then
        gs_Action = "Update"
        Select Case gs_TableName
        'Referenced product/project
        Case "RP_Product"
            C_Formulaire.b_FromCMain = True
            C_Formulaire.i_FieldCount = 5
            C_Formulaire.s_ScreenConstantsReq = "EXEC Screen_Csts 'RP_ProductUpd', '" & gut_LangLogin.Code & "'"
            C_Formulaire.s_Req = "EXEC RP_Product_upd $ID$,'$Field1$','$Field2$',$UCode$,'$Field3$','$Field4$','$Field5$'"
            C_Formulaire.e_Action = vbUpdate
            '
            C_Formulaire.s_ID = gs_TableCode
            C_Formulaire.i_Concurency = gs_TableCode2
            C_Formulaire.Field1.s_InitialValue = gs_TableCode3
            C_Formulaire.Field2.s_InitialValue = gs_TableCode4
            C_Formulaire.Field3.s_InitialValue = gs_TableCode5
            C_Formulaire.Field4.s_InitialValue = gs_TableCode6
            C_Formulaire.Field5.s_InitialValue = gs_TableCode7
            C_Formulaire.ml_Width2 = 8000
            C_Formulaire.mb_NoInternet = True
            C_Formulaire.s_ReturnLine = "$ID$" & Chr(9) & "$iConc$" & Chr(9) & "$Field1$" & Chr(9) & "$Field2$" & Chr(9) & "$Field3$" & Chr(9) & "$Field4$" & Chr(9) & "$Field5$"             '
            C_Formulaire.show 1
            If gb_Return Then GridSort C_main.Grid, Array(1, 3, 4), Array(KO, KO, KO)
        'Competitive DB
        Case "MKT_Attachment_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_AttachmentUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_Attachment_Type_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_BusMod_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_BusModUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_BusMod_Type_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_CHNL_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CHNLUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_CHNL_Type_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_Com_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CommUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_Com_Type_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_Competitor"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_CompUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_Competitor_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_ComplianceRNKG"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_ComplianceUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_ComplianceRNKG_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_GP_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_GPUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_GP_Type_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_Position"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_PositionUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_Position_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_Prod_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_ProductionUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_Prod_Type_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_SalesOffice_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SOUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_SalesOffice_Type_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_TSRating"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_TechnicalUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_TSRating_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_Super_Categories"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SCGUpd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC MKT_Super_Categories_upd $Key$, '$Desc$', $UID$ "
            gi_CodeSize = 30
            C_compdesc_mtnc.CompetitiveDB = True
            C_compdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_Super_Base_Material"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_SBMUpd'"
            gs_ParamReqUpd = "EXEC MKT_Super_Base_Material_upd $Key$, '$Desc$', $UID$"
            gi_CodeSize = 30
            C_SimpleDesc_mtnc.CompetitiveDB = True
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "MKT_Base_Material"
            gs_ParamReqCsts = "EXEC Screen_Csts 'MKT_BMUpd'"
            gs_ParamReqUpd = "EXEC MKT_Base_Material_upd $Key$, '$Desc$', $UID$"
            gi_CodeSize = 30
            C_SimpleDesc_mtnc.CompetitiveDB = True
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        
        ' REMOVED 7.11.2005 JULO
'        Case "Area_Manager"
'            AreaManager_Mtnc.show 1
        Case "BI_Marketing"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_BI_Marketing', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC BI_Marketing_upd '" & gs_CGCode & "', "
            gi_CodeSize = 10
            C_monodesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Base_Material"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_BaseMat', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Base_Material_upd"
            gut_Param.Str1 = "EXEC Super_Base_Material_cbo '" & gs_CGCode & "','" & gut_LangWork.Code & "'"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Categories"
            Categories_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Claim_Contact"
            Plant_cont_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Claim_Coordinator"
            Claim_Coord.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Claim_Letter"
            Letclai_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
        Case "Claim_Nature"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_natclai'"
            gs_ParamReqUpd = "EXEC Claim_Nature_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Claim_Recommendation"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_clairec'"
            gs_ParamReqUpd = "EXEC Claim_Recommendation_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Colours"
            Colour_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
       Case "Company_Activity"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Company_Ac'"
            gs_ParamReqUpd = "EXEC Company_Activity_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Offer_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Offer_Type'"
            gs_ParamReqUpd = "EXEC Offer_Type_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Offer_Internet"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Offer_Int'"
            gs_ParamReqUpd = "EXEC Offer_Internet_upd"
            gut_Param.Str1 = "Offer_Internet"
            C_SimpleDesc_mtnc.show 1
                    If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
        Case "Countries"
            Country_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Country_Link"
            gut_Param.Str2 = "EXEC Country_Link_ins "
            gut_Param.Str3 = "EXEC Country_Link_del "
            gut_Param.Str5 = "Criteria_Choice_upd"
            gut_Param.Str6 = gs_TableCode2
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CountryLink ', '"
            gut_Param.Str8 = "EXEC Internet_Language_cbo "
            gut_Param.Str9 = "EXEC Internet_Language_cbo2 "
            FillEmpty_Mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
       Case "Criteria_Choice"
             ' requetes for updating the list Criteria Choice link
            gut_Param.Str2 = "EXEC Criteria_Choice_Link_ins "
            gut_Param.Str3 = "EXEC Criteria_Choice_Link_del "
            ' requete for updating criteria list desc, internet flag, drop date
            gut_Param.Str5 = "Criteria_Choice_upd"
            gut_Param.Str6 = gs_TableCode2
            ' requete to get the labels of the fields
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CritChoice', '"
            gut_Param.Str8 = "EXEC Criteria_Choice_Link_cbo "
            gut_Param.Str9 = "EXEC Criteria_Choice_Link_cbo2 "
            ' because the identify is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
            ' sort the columns of the grid
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Criteria_List"
            ' requetes for updating the list Criteria List link
            gut_Param.Str2 = "EXEC Criteria_List_Link_ins "
            gut_Param.Str3 = "EXEC Criteria_List_Link_del "
            ' requete for updating criteria list desc, internet flag, drop date and the two combos
            gut_Param.Str5 = "Criteria_List_upd"
            gut_Param.Str6 = gs_TableCode2
            ' requete to get the labels of the fields
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_CritList', '"
            ' requete for filling the two lists
            gut_Param.Str8 = "EXEC Criteria_List_Link_cbo "
            gut_Param.Str9 = "EXEC Criteria_List_Link_cbo2 "
            ' because the identify is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
            ' sort the columns of the grid
            If gb_Return Then GridSort Grid, Array(3, 5, 6), Array(KO, KO, KO)
        Case "Currencies"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Currenc', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Currencies_upd"
            gi_CodeSize = 4
            C_monodesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "DC_Carrier"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Carrier', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC DC_Carrier_upd"
            gi_CodeSize = 10
            DC_CarrierComp.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "DC_Calendar"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Calendar', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC DC_Max_Activity_upd '" & DC_Choice2.cbo_Ship_DC_code.List(DC_Choice2.cbo_Ship_DC.ListIndex) & "', "
            DC_Calendar.show 1
            If gb_Return Then GridSort Grid, Array(0), Array(KO)
        Case "DC_Interco"
            Debug.Assert (False)
        Case "DC_Int_End"
            Debug.Assert (False)
        Case "DC_Receipts"
            Debug.Assert (False)
        Case "DC_Rec_End"
            Debug.Assert (False)
        Case "DC_Containers"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Containers', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC DC_Containers_upd"
            Call Launch_DC_Container(gs_TableCode)
'            DC_Containers.show 1
            If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
        Case "DC_Cont_End"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_DC_Containers', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC DC_Cont_End_upd"
            Call Launch_DC_Container(gs_TableCode)
'            DC_Containers.show 1
            If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
        Case "Definition"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Definition'"
            gs_ParamReqUpd = "EXEC Media_Definition_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Dist_Centre"
            Dist_centre_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Estimate_GridType"
            If gs_CGCode = "C002" Then
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstType', '" & gut_LangLogin.Code & "'"
            Else
                gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstType4', '" & gut_LangLogin.Code & "'"
            End If
            gs_ParamReqUpd = "EXEC Estimate_GridType_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
         Case "Estimate_Length"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstLength', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Estimate_Length_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
         Case "Estimate_Slot"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_EstSlot', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Estimate_Slot_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Budgeted_Exchange_Rates"
            ExchangeRate_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1, 2), Array(KO, OK)
        Case "Exchange_Rates"
            ExchangeRate_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1, 2, 3), Array(KO, OK, OK)
        Case "File_Extension"
            File_ext_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Geographic_Markets"
            C_InOut_Mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Glossary"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Glossary',"
            gs_ParamReqUpd = "EXEC Glossary_upd"
            C_Memo.show 1
            If gb_Return Then GridSort Grid, Array(0, 1), Array(KO, KO)
        Case "Grid_Description"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Desc'"
            gs_ParamReqUpd = "EXEC Grid_Description_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Grid_Manufacturer"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Man'"
            gs_ParamReqUpd = "EXEC Grid_Manufacturer_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Grid_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Grid_Type'"
            gs_ParamReqUpd = "EXEC Grid_Type_upd"
            gut_Param.Str1 = "EXEC Grid_Manufacturer_cbo '" & gut_LangWork.Code & "'"
            gut_Param.Str2 = "Integer"
            C_DescCbo_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Hyper_Base_Material"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_HyperBM'"
            gs_ParamReqUpd = "EXEC Hyper_Base_Material_upd"
            gut_Param.Str1 = "Hyper_Base_Material"
            C_SimpleDesc_mtnc.show 1
            ' after an add function we sort the grid
            If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
        Case "Internet_Area"
           C_InOut_Mtnc.show 1
        Case "Media_Interest"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Interest'"
            gs_ParamReqUpd = "EXEC Media_Interest_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Logistic_Markets"
            C_InOut_Mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Sales_Markets"
            C_InOut_Mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Market_Objectives"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Objectives'"
            gs_ParamReqUpd = "EXEC media_Market_Objectives_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Market_Segmentation"
            gut_Param.Str2 = "EXEC Recommended_Comb_ins"
            gut_Param.Str3 = "EXEC Recommended_Comb_del"
            gut_Param.Str5 = "Market_Segmentation_upd"
            gut_Param.Str6 = gs_TableCode2
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_RecComb', '"
            gut_Param.Str8 = "EXEC Recommended_Area_cbo2"
            gut_Param.Str9 = "EXEC Recommended_Area_cbo3"
            gut_Param.Str11 = ""
            FillEmpty_Mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Measurement_System"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_MeaSyst', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Measurement_System_upd"
            gi_CodeSize = 1
            C_monodesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Media_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Media_Type'"
            gs_ParamReqUpd = "EXEC Media_Type_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
'        Case "Media_Short_Classif"                 ' task409 JN
'            Media_Short_Classif_CMain_Upd
        Case "Media_CountriesLanguage"
            gs_Action = "upd"
            News_mtnc.ms_MediaCode = gs_TableCode
            News_mtnc.ms_MediaTitle = gs_TableCode2
            News_mtnc.ms_Language = gs_TableCode3
            News_mtnc.ms_LangDesc = gs_TableCode4
            News_mtnc.mi_Conc = gs_TableCode5
            News_mtnc.show 1
            If gb_Return Then
                GridSort Grid, Array(2), Array(KO)
                frm_im_main.Tv_MediaOutline.LocalDelItem gs_MediaCode
                frm_im_main.Tv_MediaOutline.LocalAddItem gs_MediaCode
            End If
        Case "Owner"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Owner'"
            gs_ParamReqUpd = "EXEC Owner_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Pattern_Group"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_PatGroup'"
            gs_ParamReqUpd = "EXEC Pattern_Group_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Plants"
            Plants_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Possible_Area_Comb"
            PossibleList_Mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Priv_Labels"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_PrivLab', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Priv_Labels_upd"
            gi_CodeSize = 2
            C_monodesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Product_Combine"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_ProdComb'"
            gs_ParamReqUpd = "EXEC Product_Combine_upd"
            gut_Param.Str1 = "Product_Combine"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2, 3), Array(KO, KO)
        Case "Product_Dimension"
            ProdDim_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(3, 5, 7, 9), Array(KO, KO, KO, KO)
        Case "Product_Height"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_height', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Product_Height_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(OK)
        Case "Product_Module"
            ProdMod_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Products_Edges"
            ' requetes for updating the list Value link link
            gut_Param.Str2 = "EXEC Edge_Link_ins "
            gut_Param.Str3 = "EXEC Edge_Link_del "
            ' requete for updating criteria list desc, internet flag, drop date and the two combos
            gut_Param.Str5 = "Products_Edges_upd"
            gut_Param.Str6 = gs_TableCode2
            ' requete to get the labels of the fields
            If gs_TableName = "Products_Groups" Then
                gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Group', '"
            Else
                gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Edge', '"
            End If
            ' requete for filling the two lists
            gut_Param.Str8 = "EXEC Edge_Link_cbo "
            gut_Param.Str9 = "EXEC Edge_Link_cbo2 "
            ' because the identify is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
            ' sort the columns of the grid
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Products_Groups"
            ' requetes for updating the list Value link link
            gut_Param.Str2 = "EXEC Edge_Link_ins "
            gut_Param.Str3 = "EXEC Edge_Link_del "
            ' requete for updating criteria list desc, internet flag, drop date and the two combos
            gut_Param.Str5 = "Products_Edges_upd2"
            gut_Param.Str6 = gs_TableCode2
            ' requete to get the labels of the fields
            If gs_TableName = "Products_Groups" Then
                gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Group', '"
            Else
                gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Edge', '"
            End If
            ' requete for filling the two lists
            gut_Param.Str8 = "EXEC Edge_Link_cbo "
            gut_Param.Str9 = "EXEC Edge_Link_cbo2 "
            ' because the identify is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
            ' sort the columns of the grid
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Products_Edges_Memo"
            Products_Edges_Memo
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Products_Families"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Family', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Products_Families_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Products_Patterns"
            ' requetes for updating the list Value link link
            gut_Param.Str2 = "EXEC Pattern_Link_ins "
            gut_Param.Str3 = "EXEC Pattern_Link_del "
            ' requete for updating criteria list desc, internet flag, drop date and the two combos
            gut_Param.Str5 = "Products_Patterns_upd"
            gut_Param.Str6 = gs_TableCode2
            ' requete to get the labels of the fields
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Pattern', '"
            ' requete for filling the two lists
            gut_Param.Str8 = "EXEC Pattern_Link_cbo "
            gut_Param.Str9 = "EXEC Pattern_Link_cbo2 "
            ' because the identify is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
            ' sort the columns of the grid
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Products_Segmentation"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Segment', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Products_Segmentation_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Media_Quality_On_Screen"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Quality'"
            gs_ParamReqUpd = "EXEC Media_Quality_On_Screen_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Recommended_Area"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Rec_Area'"
            gs_ParamReqUpd = "EXEC Recommended_Area_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_MetalSystem"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMSY'"
            gs_ParamReqUpd = "EXEC Quot_MetalSystem_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_MetalBorder"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMB'"
            gs_ParamReqUpd = "EXEC Quot_MetalBorder_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_MetalFinish"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMF'"
            gs_ParamReqUpd = "EXEC Quot_MetalFinish_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_MetalMaterial"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMM'"
            gs_ParamReqUpd = "EXEC Quot_MetalMaterial_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_MetalGasket"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMG'"
            gs_ParamReqUpd = "EXEC Quot_MetalGasket_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_MetalPerforation"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMPE'"
            gs_ParamReqUpd = "EXEC Quot_MetalPerforation_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_MetalEdge"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QME'"
            gs_ParamReqUpd = "EXEC Quot_MetalEdge_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_MetalAcoustic"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QMA'"
            gs_ParamReqUpd = "EXEC Quot_MetalAcoustic_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Sales_Offices", "Int_Stract_Region"
            Sales_off_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "SalesProject"
            Sales_project_Mtnc.b_UseWithCMain = OK
            Sales_project_Mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Sales_Reps_Assignement"
            Salrepa_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Sales_Reps"
            Salreps_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Shapes"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Shape', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Shapes_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Form"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Shape', '" & gut_LangLogin.Code & "'"     ' JN reuse screen constants from Shape
            gs_ParamReqUpd = "EXEC Form_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Source_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Source_Type'"
            gs_ParamReqUpd = "EXEC Media_Area_Type_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
         Case "Super_Base_Material"
            gut_Param.Str2 = "EXEC Base_Material_Link_ins '" & gs_CGCode & "',"
            gut_Param.Str3 = "EXEC Base_Material_Link_del '" & gs_CGCode & "',"
            gut_Param.Str5 = "EXEC Super_Base_Material_upd"
            gut_Param.Str6 = gs_TableCode2
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_SupBaseMat', '"
            ' requete to get the non selected base material
            gut_Param.Str8 = "EXEC Base_Material_cbo3 '" & gs_CGCode & "',"
            ' requete to get the selected base material
            gut_Param.Str9 = "EXEC Base_Material_cbo4 '" & gs_CGCode & "',"
            gut_Param.Str11 = ""
            FillEmpty_Mtnc.show 1
            ' Gere le tri
            If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
        Case "Super_Categories"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_SupCate', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Super_Categories_upd"
            gi_CodeSize = 3
            C_monodesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Suppliers"
            Supplie_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Support"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Support'"
            gs_ParamReqUpd = "EXEC Media_Source_Support_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Surfaces"
            ' requetes for updating the list Value link link
            gut_Param.Str2 = "EXEC Surface_Link_ins "
            gut_Param.Str3 = "EXEC Surface_Link_del "
            ' requete for updating criteria list desc, internet flag, drop date and the two combos
            gut_Param.Str5 = "Surfaces_upd"
            gut_Param.Str6 = gs_TableCode2
            ' requete to get the labels of the fields
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Surface', '"
            ' requete for filling the two lists
            gut_Param.Str8 = "EXEC Surface_Link_cbo "
            gut_Param.Str9 = "EXEC Surface_Link_cbo2 "
            ' because the identify is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
            ' sort the columns of the grid
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Surfaces_Memo"
            Surfaces_Memo
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Tech"
            gs_ParamReqCsts = gut_Param.Str8
            gs_ParamReqUpd = "EXEC Tech_Value_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then
                Select Case gut_Param.Str1
                Case "FireReac", "FireRes", "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
                    GridSort Grid, Array(1, 4), Array(KO, KO)
                Case "Density", "Humidity", "Weight", "Thermal"
                    GridSort Grid, Array(4), Array(OK)
                Case Else
                    GridSort Grid, Array(4), Array(KO)
                End Select
            End If
        Case "Tech_Value_Option"
            gs_ParamReqCsts = gut_Param.Str18
            gs_ParamReqUpd = "EXEC Tech_Value_Option_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then
                GridSort Grid, Array(2), Array(KO)
            End If
        Case "Tech_Value_Curve"
            gs_ParamReqCsts = gut_Param.Str23
            gs_ParamReqUpd = "EXEC Tech_Value_Curve_upd " & gut_Param.Str25 & ", "
            Tech_Value_Curve.show 1
            If gb_Return Then
                GridSort Grid, Array(2), Array(KO)
            End If
        Case "Tech_Value"
            Tech_DenVal_mtnc.show 1
        Case "Territories"
            Territo_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Test_Category"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Test_Categ'"
            gs_ParamReqUpd = "EXEC Test_Category_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Test_House"
            Test_House_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Test_Market"
            Test_Market_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(3, 4), Array(KO, KO)
        Case "Test_Standard"
            Test_Standard_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2, 4), Array(KO, KO)
        Case "Test_Type"
            Test_Type_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1, 4), Array(KO, KO)
        Case "Test_Dtl_Condition"
            gut_Param.Str1 = "Test_Typ_Condition"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_dtlcnd'"
            gs_ParamReqUpd = "EXEC Test_dtl_Condition_upd"
            C_DescCbo_mtnc.show 1
            ' To change
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Test_Typ_Condition"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_typcnd', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Test_Typ_Condition_upd"
            C_monodesc_mtnc.show 1
            ' To Change
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Test_Dtl_Result"
            gut_Param.Str1 = "Test_Result"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Tst_dtlrsl', '" & gut_LangLogin.Code & "'"
            gs_ParamReqIns = "EXEC Test_dtl_Result_upd"
            Test_Standard_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(3), Array(KO)
        Case "Test_House_Acred"
            gut_Param.Str11 = "Integer"
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Test_THOA', '"
            FillEmpty_Mtnc.show 1
            If gb_Return Then GridSort Grid, Array(3, 4, 5), Array(KO, KO, KO)
        Case "TopBottomPage"
            MouseOff
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_TopBottom'"
            gs_Param2Req1 = "EXEC position_cbo"
            gs_Param2Req2 = "EXEC companies_cbo1"
            gs_Param2Req3 = "EXEC TopBottomPage_sel " & gs_TableCode
            gs_ParamReqUpd = "EXEC TopBottomPage_Upd " & gs_TableCode & ",2"
            gut_Param.Str1 = "2"
            gut_Param.Str2 = "OK"
            gut_Param.Str3 = "OK"
            gut_Param.Str4 = "KO"
            gut_Param.Str5 = gs_TableCode
            gut_Param.Str6 = ""
            gut_Param.Str7 = gs_TableCode4
            gut_Param.Str8 = gs_TableCode5
            gut_Param.Str9 = gs_TableCode6
            gut_Param.Str10 = gs_TableCode7
            gut_Param.Str11 = gs_TableCode9
            gut_Param.Str12 = gs_TableCode11
            gut_Param.Str13 = gs_TableCode2
            C_MemoCombo.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
            MouseOn
        Case "Type_Of_Memo"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Memo_Type'"
            gs_ParamReqUpd = "EXEC Media_Type_Of_Memo_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Type_Of_View"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Media_Type_Of_View'"
            gs_ParamReqUpd = "EXEC Media_Type_Of_View_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Unit_Of_Measure"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_UniMeas', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Unit_Of_Measure_upd"
            gi_CodeSize = 4
            C_monodesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Value_Type"
            ' requetes for updating the list Criteria List link
            gut_Param.Str2 = "EXEC Value_Type_Link_ins "
            gut_Param.Str3 = "EXEC Value_Type_Link_del "
            ' requete for updating criteria list desc, internet flag, drop date and the two combos
            gut_Param.Str5 = "EXEC Value_Type_upd"
            gut_Param.Str6 = gs_TableCode2
            ' requete to get the labels of the fields
            gut_Param.Str7 = "EXEC Screen_Csts 'mtnc_Value_Type', '"
            ' requete for filling the two lists
            gut_Param.Str8 = "EXEC Value_Type_Link_cbo "
            gut_Param.Str9 = "EXEC Value_Type_Link_cbo2 "
            ' because the identify is an integer
            gut_Param.Str11 = "Integer"
            FillEmpty_Mtnc.show 1
            ' sort the columns of the grid
            If gb_Return Then GridSort Grid, Array(3, 5, 6), Array(KO, KO, KO)
        Case "Viewer"
            Viewer_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Visible_On"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Visible_On'"
            gs_ParamReqUpd = "EXEC Media_Displays_upd"
            C_SimpleDesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(1), Array(KO)
        Case "Quot_LoseReason"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_LoseReason' , '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Quot_LoseReason_upd "
            gi_CodeSize = 10
            C_monodesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Quot_Comment"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_QuotComm',"
            gs_ParamReqUpd = "EXEC Quot_Comment_upd"
            C_Memo.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "DGrid_MainRunner"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_MainRunner', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC DGrid_MainRunner_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "DGrid_CrossTee"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_CrossTee', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC DGrid_CrossTee_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "DGrid_Interface"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_Interface', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC DGrid_Interface_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "DGrid_Group"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_DGrid_Group', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC DGrid_Group_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "ProductsFamilies_Group"
            PF_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "AccProductsFamilies_Group"
            PF_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "PFG_Category"
            Categories_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "APFG_Category"
            Categories_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Ceiling_InternetGroup"
            gs_ParamReqCsts = "EXEC Screen_Csts 'm_Ceil_IntGroup', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Ceiling_InternetGroup_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Perforation_Shape"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Perforation_Shape', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Perforation_Shape_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Perforation"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Perforation', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Perforation_upd"
            Perforation_Design.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        Case "Component_Type"
            gs_ParamReqCsts = "EXEC Screen_Csts 'mtnc_Component_Type', '" & gut_LangLogin.Code & "'"
            gs_ParamReqUpd = "EXEC Component_Type_upd"
            C_categdesc_mtnc.show 1
            If gb_Return Then GridSort Grid, Array(2), Array(KO)
        End Select
        If gb_Return Then
            FillGrid3
        End If
    Else
        Select Case gs_TableName
            Case "Quot_Comment"
                gut_Param2.Str1 = "Quot_Comment"
                Trans_mtnc.show 1
                FillGrid3
            Case "TopBottomPage"
                gut_Param2.Str1 = "TopBottomPage"
                Trans_mtnc.show 1
                If gb_Return = OK Then
                    GridSort Grid, Array(2), Array(KO)
                    FillGrid3
                End If
            Case Else
                Trans_Data.show 1
                If gb_Return Then
                    Select Case gs_TableName
                        Case "BI_Marketing"
                            GridSortOneLine Grid, Array(2), Array(KO), Grid.Row
                        Case "Colours", "Currencies", "Definition", "Market_Objectives", "Media_Type", "Media_Quality_On_Screen", "Sales_Reps_Assignement", "Sales_Reps", "Source_Name", "Source_Type", "Support", "Territories", "Test_Standard", "Test_Type", "Type_Of_Memo", "Type_Of_View", "Media_View_Area", "Visible_On"
                            GridSort Grid, Array(1), Array(KO)
                        Case "Claim_Letter", "Hyper_Base_Material", "Super_Base_Material"
                            GridSort Grid, Array(3, 4), Array(KO, KO)
                        Case "Value_Type", "Criteria_List"
                            GridSort Grid, Array(3, 5, 6), Array(KO, KO, KO)
                        Case Else
                            GridSort Grid, Array(2), Array(KO)
                    End Select
                    FillGrid3
                End If
        End Select
    End If
End If
MouseOn

End Sub
Private Sub pic_quit_Click()

'MouseOff
gs_CGCode = ""
Unload Me

End Sub
Private Sub FillGrid3()

Dim li_Count As Integer
Dim li_Count2 As Integer
Dim li_Grid2Col As Integer
Dim li_CurrentRow As Integer

On Error GoTo suite

li_CurrentRow = Grid.Row

' Grid sizing (visible grid)
Grid.Row = 1
Grid.Col = 0
mi_NbRows = Grid.Rows
If Grid.Rows = 2 And Grid.Text = "" Then
    Grid2.Rows = 2
Else
    Grid2.Rows = mi_NbRows
End If
Grid2.Cols = 1
li_Grid2Col = -1
For li_Count = 0 To 29
    If gi_GridWidth(li_Count) > 1 Then
    ' Cols filling (visible grid)
'        Grid.Col = li_Count
        li_Grid2Col = li_Grid2Col + 1
        Grid2.Cols = li_Grid2Col + 1
'        Grid2.Col = li_Grid2Col
        Grid2.ColWidth(li_Grid2Col) = gi_GridWidth(li_Count)
        Grid2.ColAlignment(li_Grid2Col) = flexAlignLeftCenter

        For li_Count2 = 0 To mi_NbRows - 1
            Grid2.TextMatrix(li_Count2, li_Grid2Col) = Grid.TextMatrix(li_Count2, li_Count)
'            Grid.Row = li_Count2
'            Grid2.Row = li_Count2
'            Grid2.Text = Grid.Text
        Next li_Count2
    End If
Next li_Count
Grid.Row = 1
Grid.Col = 0
'If Grid.Rows = 2 And Grid.Text = "" Then
 '   ssp_code = 0
'Else
'    ssp_code = mi_NbRows - 1
'End If
If Grid.Rows = 2 And Grid.Text = "" Then
    gl_NbLineDisplay = 0
Else
    gl_NbLineDisplay = mi_NbRows - 1
End If
If ml_TotCount <= 0 Then
    ssp_code = gl_NbLineDisplay
Else
    'Thierry le 29/11/1999 pour Quotation
    'ssp_code = gl_NbLineDisplay & " / " & ml_TotCount
    ssp_code = gl_NbLineDisplay & " / " & gl_NbLineDisplay
End If
If li_CurrentRow = 0 Then
    li_CurrentRow = 1
End If
If li_CurrentRow > Grid2.Rows - 1 Then
    li_CurrentRow = Grid2.Rows - 1
End If
Grid2.Row = li_CurrentRow
Grid2.Col = 0
Grid2.ColSel = Grid2.Cols - 1

mi_Yav = 0
Grid2_Click

If Grid2.Row <= Grid2.Rows - 16 Then
    Grid2.TopRow = Grid2.Row
Else
    If Grid2.Rows <= 16 Then
        Grid2.TopRow = 1
    Else
        Grid2.TopRow = Grid2.Rows - 16
    End If
End If

MouseOn
Exit Sub

suite:
StdError
End Sub

Public Sub FillGrid()
' Submit filling query (option mb_ServerCursor)
Dim ls_req As String
Dim li_Count As Integer
Dim li_Status As Integer

On Error GoTo suite

MouseOff
pic_next25.Visible = KO
' Columns header (invisible grid)
Grid.Rows = 2
For li_Count = 0 To 29
    Grid.Col = li_Count
    Grid.Row = 0
    Grid.Text = gs_GridColumn(li_Count)
    Grid.Row = 1
    Grid.Text = ""
Next li_Count
' Submit filling query
ls_req = gs_ParamReq1 & gut_LangWork.Code & "'"

If Left(gs_TableName, 12) = "Claim_Report" Then
    li_Status = mo_Fetch.ExecuteQry(ls_req, KO)
Else
    li_Status = mo_Fetch.ExecuteQry(ls_req, OK)
End If

If li_Status Then
    ml_TotCount = mo_Fetch.RowCount
End If

' Fills invisible grid / by 25 (option mb_ServerCursor)
mi_NbRows = 1
Grid.Row = 1
FillGrid2

' Fills visible grid
FillGrid3

Exit Sub

suite:
StdError
End Sub

Private Sub FillGrid2()
' Fills invisible grid / by 25 (option mb_ServerCursor)
Dim li_Count, li_Count25 As Integer
Dim lb_Exit As Boolean
Dim i As Integer
Dim j As Integer
Dim li_NBcol As Integer
Dim li_CurrentRow As Integer

On Error GoTo suite

lb_Exit = False

li_NBcol = mo_Fetch.NbCol
li_CurrentRow = Grid.Row

'if the serverCursor is true, we must make only one round
'in the other case, we must read all the data
Do While (mb_ServerCursor = True And lb_Exit = False) Or (mb_ServerCursor = False And mi_NbRows <> ml_TotCount + 1)
    li_Count = mo_Fetch.FillMore
    If li_Count = 0 Then Exit Do
    For i = 1 To li_Count
        Grid.Rows = mi_NbRows + 1
        Grid.Row = mi_NbRows
        For j = 1 To li_NBcol
            Grid.Col = j - 1
            Grid.Text = mo_Fetch.GetData(i, j)
        Next
        mi_NbRows = mi_NbRows + 1
    Next
    lb_Exit = True
Loop

Grid.Row = li_CurrentRow

'we must make the "more 25" image visible or not
If li_Count = mo_Fetch.MaxRowCount And mi_NbRows <> ml_TotCount + 1 Then
    pic_next25.Visible = OK
Else
    pic_next25.Visible = KO
End If

Exit Sub

suite:
pic_next25.Visible = KO
StdError
End Sub
Private Sub Surfaces_Memo()
Dim ls_SOSLang As String

gut_Param.Str1 = gs_TableCode
gut_Param.Str2 = "Memo"
gut_Param.Str3 = ""
gut_Param.Str4 = "EXEC Surfaces_Memo_Ins"
gut_Param.Str5 = "EXEC Surfaces_Memo_Lst"
gut_Param.Str6 = "EXEC Surfaces_Memo_Del"
gut_Param.Str7 = "EXEC Surfaces_Memo_Upd"
gut_Param.Str8 = "1"
ls_SOSLang = gut_LangWork.Code
Memo_mtnc.show 1
gut_LangWork.Code = ls_SOSLang

End Sub
Private Sub Products_Edges_Memo()
Dim ls_SOSLang As String

gut_Param.Str1 = gs_TableCode
gut_Param.Str2 = "Memo"
gut_Param.Str3 = ""
gut_Param.Str4 = "EXEC Products_Edges_Memo_Ins"
gut_Param.Str5 = "EXEC Products_Edges_Memo_Lst"
gut_Param.Str6 = "EXEC Products_Edges_Memo_Del"
gut_Param.Str7 = "EXEC Products_Edges_Memo_Upd"
gut_Param.Str8 = "1"
ls_SOSLang = gut_LangWork.Code
Memo_mtnc.show 1
gut_LangWork.Code = ls_SOSLang

End Sub
Private Sub Permission()

Dim ls_Perm As String
Dim ll_Statement As Long
Dim li_Status As Integer

On Error GoTo suite

mb_AllowAdd = KO
mb_AllowDel = KO
mb_AllowUpd = KO
mb_AllowDelI = KO
mb_AllowUpdI = KO
mb_AllowMemo = KO
ms_LanguagePermission = ""
Select Case gs_TableName
Case "DC_Work", "Tech", "Tech_Value", "Tech_Value_Option", "Claim_Report1", "Claim_Report2", "Claim_Report3", "Claim_Report4", "Claim_Report5"
    mb_ServerCursor = KO
Case Else
    mb_ServerCursor = OK
End Select
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, gs_ParamReq3) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If
Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Perm = ODBCData(ll_Statement, 1)
        If ls_Perm = "Insert" And gs_TableName <> "Customer" Then
            mb_AllowAdd = OK
            mb_ServerCursor = KO
        End If
        If ls_Perm = "Delete" And gs_TableName <> "Customer" Then
            mb_AllowDel = OK
            mb_ServerCursor = KO
        End If
        If ls_Perm = "Update" Then
            mb_AllowUpd = OK
            mb_ServerCursor = KO
        End If

        If ls_Perm = "UpdateI" Then
            mb_AllowUpdI = OK
            mb_ServerCursor = KO
        End If
        If ls_Perm = "DeleteI" Then
            mb_AllowDelI = OK
            mb_ServerCursor = KO
        End If
        If ls_Perm = "Memo" Then
            mb_AllowMemo = OK
            mb_ServerCursor = KO
        End If
        If Left(ls_Perm, 3) = "99_" Then
            ms_LanguagePermission = ms_LanguagePermission & right(ls_Perm, Len(ls_Perm) - 3)
            mb_ServerCursor = KO
        End If
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

suite:
StdError
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
End Sub
Private Function TransPerm() As Boolean

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

On Error GoTo Err_Perm

If InStr(1, ms_LanguagePermission, gut_LangWork.Code, 1) <> 0 Then
    TransPerm = OK
Else
    TransPerm = KO
End If

'Check if a technical value can be translated
ls_req = "Exec Tech_Value_Untranslated_sel '" & ms_SubMenu & "'"

If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQLRowCount(ll_Statement, ll_lngrows)
    If ll_lngrows <> 0 Then
        TransPerm = KO
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    End If
Else
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    TransPerm = KO
End If

Exit Function

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

Private Sub ShowButtons()

If gut_LangWork.Code = "E" Then
    pic_Memo.Visible = mb_AllowMemo
    pic_add.Visible = mb_AllowAdd
    pic_upd.Visible = mb_AllowUpd
    If gs_WorkFlow = "yes" Then
        pic_delete.Visible = OK
    Else
        pic_delete.Visible = mb_AllowDel
    End If
    If gl_NbLineDisplay > 0 And Grid2.Row > 0 Then
'        Grid2.Row = Grid2.SelStartRow
'        Grid2.Col = gi_ColumnIFlag
        If Grid2.TextMatrix(Grid2.Row, gi_ColumnIFlag) = "X" Then
            If Not (mb_AllowUpd) And mb_AllowUpdI Then
                pic_upd.Visible = KO
            End If
            If Not (mb_AllowDel) And mb_AllowDelI Then
                pic_delete.Visible = KO
            End If
        Else
            If mb_AllowUpdI Then
                pic_upd.Visible = OK
            End If
            If mb_AllowDelI Then
                pic_delete.Visible = OK
            End If
        End If
    End If
Else
    pic_add.Visible = KO
    pic_upd.Visible = TransPerm
    If gs_WorkFlow = "yes" Then
        pic_delete.Visible = OK
    Else
        pic_delete.Visible = KO
    End If
End If

End Sub



Private Sub MainCsts()

Dim ls_Field As String
Dim ls_Text As String
Dim ll_Statement As Long
Dim li_Status As Integer

On Error GoTo suite

If SQLSubmit(gl_Environment, gl_Database, ll_Statement, gs_ParamReq2) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If
Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Field = ODBCData(ll_Statement, 1)
        ls_Text = ODBCData(ll_Statement, 2)
        Select Case ls_Field
        Case "title": Caption = ls_Text
        Case "lbl_Category": lbl_Category = ls_Text
        Case "lbl_record": lbl_Rcd = ls_Text
        Case "c0": gs_GridColumn(0) = ls_Text
        Case "c1": gs_GridColumn(1) = ls_Text
        Case "c2": gs_GridColumn(2) = ls_Text
        Case "c3": gs_GridColumn(3) = ls_Text
        Case "c4": gs_GridColumn(4) = ls_Text
        Case "c5": gs_GridColumn(5) = ls_Text
        Case "c6": gs_GridColumn(6) = ls_Text
        Case "c7": gs_GridColumn(7) = ls_Text
        Case "c8": gs_GridColumn(8) = ls_Text
        Case "c9": gs_GridColumn(9) = ls_Text
        Case "c10": gs_GridColumn(10) = ls_Text
        Case "c11": gs_GridColumn(11) = ls_Text
        Case "c12": gs_GridColumn(12) = ls_Text
        Case "c13": gs_GridColumn(13) = ls_Text
        Case "c14": gs_GridColumn(14) = ls_Text
        Case "c15": gs_GridColumn(15) = ls_Text
        Case "c16": gs_GridColumn(16) = ls_Text
        Case "c17": gs_GridColumn(17) = ls_Text
        Case "c18": gs_GridColumn(18) = ls_Text
        Case "c19": gs_GridColumn(19) = ls_Text
        Case "c20": gs_GridColumn(20) = ls_Text
        Case "c21": gs_GridColumn(21) = ls_Text
        Case "c22": gs_GridColumn(22) = ls_Text
        Case "c23": gs_GridColumn(23) = ls_Text
        Case "c24": gs_GridColumn(24) = ls_Text
        Case "c25": gs_GridColumn(25) = ls_Text
        Case "c26": gs_GridColumn(26) = ls_Text
        Case "c27": gs_GridColumn(27) = ls_Text
        Case "c28": gs_GridColumn(28) = ls_Text
        Case "c29": gs_GridColumn(29) = ls_Text
        End Select
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Select Case gs_TableName
Case "Base_Material", "Colours", "Priv_Labels", "Product_Dimension", "Product_Height", "Product_Module", "Products_Edges", "Products_Families", "Products_Groups", "Products_Patterns", "Products_Segmentation", "Shapes", "Surfaces", "Super_Base_Material", "BI_Marketing", "Estimate_GridType", "Estimate_Slot", "Estimate_Length", "Surfaces_Memo", "Products_Edges_Memo", "Perforation_Shape", "Perforation", "Component_Type", "Form"
    lbl_Category = lbl_Category & " " & gs_MenuChoice
Case "DC_Interco", "DC_Customer", "DC_Containers"
    Debug.Assert (False)
Case "DC_Receipts"
    Debug.Assert (False)
Case "DC_Calendar"
    lbl_Category = "Distribution Center : " & DC_Choice2.cbo_Ship_DC & " - Date " & DC_Choice2.cbo_month & "/" & DC_Choice2.cbo_year
Case "DC_Work"
    lbl_Category = SPACE(25) & "|" & SPACE(6) & "Customer shipments " & SPACE(6) & "|" & SPACE(3) & "Intercompany shipments" & SPACE(3) & "|" & SPACE(16) & "Receipts" & SPACE(15) & "|" & SPACE(13) & "Containers" & SPACE(12) & "|"
    Caption = Caption & " - " & DC_Choice2.cbo_Ship_DC & " - Month : " & DC_Choice2.cbo_month & "/" & DC_Choice2.cbo_year
End Select
Exit Sub

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

Dim li_Count As Integer

For li_Count = 0 To lst_ForDelete.ListCount - 1
  PbToSolve_Delete lst_ForDelete.List(li_Count)
Next li_Count

End Sub



Public Sub ShowOrder()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer

On Error GoTo suite

pic_Order.Visible = KO
'ls_Req = "TableSortedShow '" & gs_TableName & "'"
ls_req = "TableSortedShow '" & gs_TableName & "', '" & prg.LoginName & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    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
            pic_Order.Visible = OK
            'pic_Order.Picture = LoadResPicture(RES_ORDER, 1)
        End If
    Loop
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

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

' NEW Remove ListView begin
Private Function GetTagValue(ByVal ao_lvw As MSComctlLib.ListItem, ByVal al_Index As Long)
    Dim ls_values() As String
    ls_values = Split(ao_lvw.Tag, SEP)

    GetTagValue = ls_values(al_Index)

End Function

Private Function LoadImage(ByVal ao_ImageList As MSComctlLib.ImageList, ByVal al_resIndex As Long, ByVal al_resType As LoadResConstants) As Long
    Dim lo_image As MSComctlLib.ListImage
    Set lo_image = ao_ImageList.ListImages.Add(, "_" & al_resIndex, LoadResPicture(al_resIndex, al_resType))
    LoadImage = lo_image.Index
End Function

Private Sub InitListView(ByRef ao_lvw As MSComctlLib.ListView, Optional ByVal ao_imgList As MSComctlLib.ImageList = Nothing)
    ao_lvw.HideSelection = False        ' don't hide selection when lostFocus
    ao_lvw.View = lvwReport
    ao_lvw.LabelEdit = lvwManual       ' disable edit labels
    ao_lvw.Icons = ao_imgList
    ao_lvw.SmallIcons = ao_imgList
End Sub

Private Sub InitImageList(ByRef ao_imgList As MSComctlLib.ImageList)
    ao_imgList.ImageHeight = 32
    ao_imgList.ImageWidth = 32
    ao_imgList.MaskColor = vbMagenta

    ' at least one image must be loaded to correctly initialize imagelist
    Call LoadImage(ao_imgList, RES_OPENFOLDER, vbResBitmap)
End Sub
' NEW Remove ListView end

Private Function Launch_DC_Container(ByVal al_TRANS_Code As Long) As Boolean
    On Error GoTo onError
    
    MouseOff
    
    If mo_DC_Contailner Is Nothing Then
    
        Set mo_DC_Contailner = New DC_Containers
        
        Set mo_DC_Contailner.ArmDb = aDb
        mo_DC_Contailner.Language_Code = gut_LangLogin.Code
        mo_DC_Contailner.U_Code = prg.U_Code
        mo_DC_Contailner.LoginName = prg.LoginName
        
        Call mo_DC_Contailner.SetReconnectParams(prg.CurrentServerIP & prg.ServerInstance, prg.DBName, prg.LoginName, prg.U_PWD, prg.ApplicationName & prg.ApplicationVersion)
        
        Call mo_DC_Contailner.Load_A_Com
        If Not mo_DC_Contailner.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 mo_DC_Contailner.Unload_A_Com
            Set mo_DC_Contailner = Nothing
            MouseOn
            Exit Function
        End If
    End If
    
    
    mo_DC_Contailner.DC_Code = DC_Choice.cbo_ShipDC_code.List(DC_Choice.cbo_ShipDC.ListIndex)
    mo_DC_Contailner.DC_name = DC_Choice.cbo_ShipDC.Text
    mo_DC_Contailner.ShippingDay = DC_Choice.txt_ShipDate
    mo_DC_Contailner.TRANS_Code = al_TRANS_Code
    mo_DC_Contailner.TableName = gs_TableName
    mo_DC_Contailner.InitControl
    
    MouseOn
    
    mo_DC_Contailner.show 1
    
    Launch_DC_Container = True
    Exit Function
onError:
    MouseOn
    Launch_DC_Container = False
    MsgBox "Unable to launch DC_Customer application: " & Err.Description
    Set mo_DC_Contailner = Nothing
End Function

