VERSION 5.00
Begin VB.Form Tech_DenVal_mtnc 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   3225
   ClientLeft      =   915
   ClientTop       =   2145
   ClientWidth     =   7890
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   3225
   ScaleWidth      =   7890
   ShowInTaskbar   =   0   'False
   Begin VB.Frame frm_Value 
      BackColor       =   &H00C0C0C0&
      BorderStyle     =   0  'None
      Height          =   375
      Left            =   3840
      TabIndex        =   30
      Top             =   1320
      Width           =   4035
      Begin VB.ComboBox cbo_Value2 
         Height          =   315
         Left            =   3420
         Style           =   2  'Dropdown List
         TabIndex        =   31
         Top             =   0
         Visible         =   0   'False
         Width           =   336
      End
      Begin VB.ComboBox cbo_Value 
         Height          =   315
         Left            =   1920
         Style           =   2  'Dropdown List
         TabIndex        =   32
         Top             =   0
         Width           =   2052
      End
      Begin VB.Label lbl_Value 
         Caption         =   "Value"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   252
         Left            =   0
         TabIndex        =   33
         Top             =   0
         Width           =   1932
      End
   End
   Begin VB.Frame frm_System 
      BackColor       =   &H00C0C0C0&
      BorderStyle     =   0  'None
      Height          =   855
      Left            =   0
      TabIndex        =   22
      Top             =   2400
      Width           =   7935
      Begin VB.TextBox txt_dropped 
         ForeColor       =   &H00FF0000&
         Height          =   288
         Left            =   1920
         Locked          =   -1  'True
         TabIndex        =   27
         Top             =   360
         Width           =   1212
      End
      Begin VB.CheckBox chk_Int 
         Caption         =   "Check1"
         Height          =   252
         Left            =   1920
         TabIndex        =   26
         Top             =   0
         Width           =   252
      End
      Begin VB.CommandButton ssp_quit 
         Height          =   612
         Left            =   7140
         Style           =   1  'Graphical
         TabIndex        =   25
         Top             =   120
         Width           =   612
      End
      Begin VB.CommandButton SSC_dropped 
         Height          =   276
         Left            =   3120
         Style           =   1  'Graphical
         TabIndex        =   24
         Top             =   360
         Width           =   252
      End
      Begin VB.CommandButton spp_save 
         Default         =   -1  'True
         Height          =   612
         Left            =   6420
         Style           =   1  'Graphical
         TabIndex        =   23
         Top             =   120
         Width           =   612
      End
      Begin VB.Label lbl_Int 
         Caption         =   "Internet flag"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   29
         Top             =   0
         Width           =   1455
      End
      Begin VB.Label lbl_Drop 
         Caption         =   "Drop date"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   28
         Top             =   360
         Width           =   1455
      End
   End
   Begin VB.ComboBox cbo_Curve2 
      Height          =   288
      Left            =   7200
      Style           =   2  'Dropdown List
      TabIndex        =   20
      TabStop         =   0   'False
      Top             =   600
      Visible         =   0   'False
      Width           =   312
   End
   Begin VB.ComboBox cbo_Curve 
      Height          =   288
      Left            =   4740
      Style           =   2  'Dropdown List
      TabIndex        =   21
      Top             =   600
      Width           =   3012
   End
   Begin VB.Frame frm_Propag 
      Caption         =   "Item propagation"
      Height          =   552
      Left            =   3780
      TabIndex        =   15
      Top             =   1800
      Width           =   3972
      Begin VB.OptionButton opt_NonDropped 
         Caption         =   "Non dropped"
         Height          =   312
         Left            =   2280
         TabIndex        =   18
         Top             =   180
         Width           =   1572
      End
      Begin VB.OptionButton opt_Dropped 
         Caption         =   "Dropped"
         Height          =   312
         Left            =   900
         TabIndex        =   17
         Top             =   180
         Width           =   1392
      End
      Begin VB.OptionButton opt_All 
         Caption         =   "All"
         Height          =   312
         Left            =   120
         TabIndex        =   16
         Top             =   180
         Value           =   -1  'True
         Width           =   792
      End
   End
   Begin VB.ComboBox cbo_Market2 
      Height          =   288
      Left            =   7200
      Style           =   2  'Dropdown List
      TabIndex        =   12
      TabStop         =   0   'False
      Top             =   180
      Visible         =   0   'False
      Width           =   312
   End
   Begin VB.TextBox txt_5 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00FF0000&
      Height          =   288
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   10
      Top             =   2040
      Visible         =   0   'False
      Width           =   1752
   End
   Begin VB.TextBox txt_4 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00FF0000&
      Height          =   288
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   8
      Top             =   1680
      Visible         =   0   'False
      Width           =   1752
   End
   Begin VB.TextBox txt_3 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00FF0000&
      Height          =   288
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   6
      Top             =   1320
      Visible         =   0   'False
      Width           =   1752
   End
   Begin VB.TextBox txt_2 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00FF0000&
      Height          =   288
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   5
      Top             =   960
      Visible         =   0   'False
      Width           =   1752
   End
   Begin VB.TextBox txt_1 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00FF0000&
      Height          =   288
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   4
      Top             =   600
      Width           =   1752
   End
   Begin VB.TextBox txt_Category 
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H00FF0000&
      Height          =   288
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   3
      Top             =   180
      Width           =   1752
   End
   Begin VB.ComboBox cbo_Market 
      Height          =   288
      Left            =   5700
      Style           =   2  'Dropdown List
      TabIndex        =   13
      Top             =   180
      Width           =   2052
   End
   Begin VB.Label lbl_Curve 
      Caption         =   "Curve"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   3780
      TabIndex        =   19
      Top             =   600
      Width           =   912
   End
   Begin VB.Label lbl_Market 
      Caption         =   "Market"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   3780
      TabIndex        =   14
      Top             =   180
      Width           =   1932
   End
   Begin VB.Label lbl_5 
      Caption         =   "Criterion 5"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   120
      TabIndex        =   11
      Top             =   2040
      Visible         =   0   'False
      Width           =   1812
   End
   Begin VB.Label lbl_4 
      Caption         =   "Criterion 4"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   120
      TabIndex        =   9
      Top             =   1680
      Visible         =   0   'False
      Width           =   1812
   End
   Begin VB.Label lbl_3 
      Caption         =   "Criterion 3"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   7
      Top             =   1320
      Visible         =   0   'False
      Width           =   1815
   End
   Begin VB.Label lbl_Category 
      Caption         =   "Product category"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   120
      TabIndex        =   2
      Top             =   180
      Width           =   1812
   End
   Begin VB.Label lbl_1 
      Caption         =   "Criterion 1"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   120
      TabIndex        =   1
      Top             =   600
      Width           =   1812
   End
   Begin VB.Label lbl_2 
      Caption         =   "Criterion 2"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   120
      TabIndex        =   0
      Top             =   960
      Visible         =   0   'False
      Width           =   1812
   End
End
Attribute VB_Name = "Tech_DenVal_mtnc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim mb_MarketNotLoaded As Boolean
Dim mb_ValueNotLoaded As Boolean
Dim mb_CurveNotLoaded As Boolean
Private Sub cbo_Curve_DropDown()

Dim ls_CurveCode As String

MouseOff
If mb_CurveNotLoaded Then
    mb_CurveNotLoaded = KO
    If cbo_Curve.ListIndex <> -1 Then
        ls_CurveCode = cbo_Curve2.List(cbo_Curve.ListIndex)
    Else
        ls_CurveCode = ""
    End If
    cbo_Curve2.Clear
    cbo_Curve.Clear
    cbo_Curve2.AddItem "0"
    cbo_Curve.AddItem ""
    FillCbo "EXEC Tech_Value_Curve_cbo " & gut_Param.Str25 & " ,'" & gut_LangWork.Code & "'", cbo_Curve2, cbo_Curve
    If ls_CurveCode <> "" Then
        cbo_Curve.ListIndex = ComboFindItem(cbo_Curve2, ls_CurveCode)
    End If
End If
MouseOn

End Sub

Private Sub Cbo_market_Click()

MouseOff
If cbo_Market.ListIndex = -1 Then
    cbo_Value.Enabled = KO
Else
    cbo_Value.Enabled = OK
End If
cbo_Value.ListIndex = -1
mb_ValueNotLoaded = OK
MouseOn

End Sub

Private Sub Cbo_market_DropDown()

Dim ls_MarketCode As String
Dim ls_catCode As String

MouseOff
If mb_MarketNotLoaded Then
    mb_MarketNotLoaded = KO
    If cbo_Market.ListIndex <> -1 Then
        ls_MarketCode = cbo_Market2.List(cbo_Market.ListIndex)
    Else
        ls_MarketCode = ""
    End If
    cbo_Market2.Clear
    cbo_Market.Clear
    Select Case gut_Param.Str1
    Case "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
        cbo_Market2.AddItem "0"
        cbo_Market.AddItem ""
        FillCbo "EXEC Tech_" & gut_Param.Str21 & "_Option_cbo '" & gut_LangWork.Code & "'", cbo_Market2, cbo_Market
    Case Else
        ls_catCode = CStr(GetCatCode(CInt(gut_Param.Str11)))
        
        FillCbo "Exec Test_Market_cbo " & ls_catCode & ",'" & gut_LangWork.Code & "'", cbo_Market2, cbo_Market
    End Select
    If ls_MarketCode <> "" Then
        cbo_Market.ListIndex = ComboFindItem(cbo_Market2, ls_MarketCode)
    End If
End If
MouseOn

End Sub
Private Sub cbo_value_DropDown()

Dim ls_ValCode As String
Dim ls_req As String

MouseOff
If mb_ValueNotLoaded Then
    mb_ValueNotLoaded = KO
    If cbo_Value.ListIndex <> -1 Then
        ls_ValCode = cbo_Value2.List(cbo_Value.ListIndex)
    Else
        ls_ValCode = ""
    End If
    cbo_Value2.Clear
    cbo_Value.Clear
    cbo_Value2.AddItem "0"
    cbo_Value.AddItem ""
    Select Case gut_Param.Str1
    Case "FireReac", "FireRes", "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
        ls_req = "EXEC Tech_" & gut_Param.Str1 & "_cbo '" & gut_LangWork.Code & "', " & cbo_Market2.List(cbo_Market.ListIndex)
    Case Else
        ls_req = "EXEC Tech_" & gut_Param.Str1 & "_cbo '" & gut_LangWork.Code & "', 0"
    End Select
    FillCbo ls_req, cbo_Value2, cbo_Value
    If ls_ValCode <> "" Then
        cbo_Value.ListIndex = ComboFindItem(cbo_Value2, ls_ValCode)
    End If
End If
MouseOn

End Sub

Private Sub Form_Load()

On Error GoTo suite

MouseOff

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

spp_save.Picture = LoadResPicture(RES_OK, 1)
ssp_quit.Picture = LoadResPicture(RES_QUIT, 1)
SSC_dropped.Picture = LoadResPicture(RES_DOWN2, vbResIcon)

Getcsts
txt_Category = gs_TableCode2
txt_1 = gs_TableCode4
Select Case gut_Param.Str1
Case "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
    lbl_Market.Visible = OK
    cbo_Market.Visible = OK
    lbl_Curve.Visible = OK
    cbo_Curve.Visible = OK
Case "FireReac", "FireRes"
    lbl_Market.Visible = OK
    cbo_Market.Visible = OK
    lbl_Curve.Visible = KO
    cbo_Curve.Visible = KO
Case Else
    lbl_Market.Visible = KO
    cbo_Market.Visible = KO
    lbl_Curve.Visible = KO
    cbo_Curve.Visible = KO
End Select
Select Case gut_Param.Str11
Case "1"
    Me.Height = 3048
    frm_Value.Top = 660
    frm_Propag.Top = 1140
    frm_System.Top = 1800
    cbo_Value2.AddItem gs_TableCode6
    cbo_Value.AddItem gs_TableCode7
    cbo_Value.ListIndex = 0
    mb_ValueNotLoaded = OK
    If gs_TableCode8 = "X" Then
        chk_Int.Value = 1
    End If
    txt_dropped = gs_TableCode9
Case "2"
    Me.Height = 3252
    frm_Value.Top = 1010
    frm_Propag.Top = 1320
    frm_System.Top = 1980
    lbl_2.Visible = OK
    txt_2.Visible = OK
    txt_2 = gs_TableCode6
    Select Case gut_Param.Str1
    Case "AcoustAW", "AcoustNRC", "AbsClass", "EquivSoundAbs"
        If gs_TableCode8 = 0 And gs_TableCode10 = 0 Then
            cbo_Market.ListIndex = -1
            cbo_Value.Enabled = KO
        Else
            cbo_Market2.AddItem gs_TableCode8
            cbo_Market.AddItem gs_TableCode9
            cbo_Market.ListIndex = 0
        End If
        If gs_TableCode12 = 0 Then
            cbo_Curve2.AddItem 0
            cbo_Curve.AddItem ""
            cbo_Curve.ListIndex = 0
        Else
            cbo_Curve2.AddItem gs_TableCode12
            cbo_Curve.AddItem gs_TableCode13
            cbo_Curve.ListIndex = 0
        End If
        mb_MarketNotLoaded = OK
        mb_CurveNotLoaded = OK
        cbo_Value2.AddItem gs_TableCode10
        cbo_Value.AddItem gs_TableCode11
        cbo_Value.ListIndex = 0
        mb_ValueNotLoaded = OK
        If gs_TableCode14 = "X" Then
            chk_Int.Value = 1
        End If
        txt_dropped = gs_TableCode15
    Case Else
        cbo_Value2.AddItem gs_TableCode8
        cbo_Value.AddItem gs_TableCode9
        cbo_Value.ListIndex = 0
        mb_ValueNotLoaded = OK
        If gs_TableCode10 = "X" Then
            chk_Int.Value = 1
        End If
        txt_dropped = gs_TableCode11
    End Select
Case "3"
    Me.Height = 3360
    frm_Value.Top = 1010
    frm_Propag.Top = 1440
    frm_System.Top = 2100
    lbl_2.Visible = OK
    txt_2.Visible = OK
    lbl_3.Visible = OK
    txt_3.Visible = OK
    txt_2 = gs_TableCode6
    txt_3 = gs_TableCode8
    Select Case gut_Param.Str1
    Case "FireReac"
        If gs_TableCode10 = 0 And gs_TableCode12 = 0 Then
            cbo_Market.ListIndex = -1
            cbo_Value.Enabled = KO
        Else
            cbo_Market2.AddItem gs_TableCode10
            cbo_Market.AddItem gs_TableCode11
            cbo_Market.ListIndex = 0
        End If
        mb_MarketNotLoaded = OK
        mb_CurveNotLoaded = OK
        cbo_Value2.AddItem gs_TableCode12
        cbo_Value.AddItem gs_TableCode13
        cbo_Value.ListIndex = 0
        mb_ValueNotLoaded = OK
        If gs_TableCode14 = "X" Then
            chk_Int.Value = 1
        End If
        txt_dropped = gs_TableCode15
    Case "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "RedInd", "Rain"
        If gs_TableCode10 = 0 And gs_TableCode12 = 0 Then
            cbo_Market.ListIndex = -1
            cbo_Value.Enabled = KO
        Else
            cbo_Market2.AddItem gs_TableCode10
            cbo_Market.AddItem gs_TableCode11
            cbo_Market.ListIndex = 0
        End If
        If gs_TableCode14 = 0 Then
            cbo_Curve2.AddItem 0
            cbo_Curve.AddItem ""
            cbo_Curve.ListIndex = 0
        Else
            cbo_Curve2.AddItem gs_TableCode14
            cbo_Curve.AddItem gs_TableCode15
            cbo_Curve.ListIndex = 0
        End If
        mb_MarketNotLoaded = OK
        mb_CurveNotLoaded = OK
        cbo_Value2.AddItem gs_TableCode12
        cbo_Value.AddItem gs_TableCode13
        cbo_Value.ListIndex = 0
        mb_ValueNotLoaded = OK
        If gs_TableCode16 = "X" Then
            chk_Int.Value = 1
        End If
        txt_dropped = gs_TableCode17
    Case Else
        cbo_Value2.AddItem gs_TableCode10
        cbo_Value.AddItem gs_TableCode11
        cbo_Value.ListIndex = 0
        mb_ValueNotLoaded = OK
        If gs_TableCode12 = "X" Then
            chk_Int.Value = 1
        End If
        txt_dropped = gs_TableCode13
    End Select
Case "4"
    Me.Height = 3528
    frm_Value.Top = 1140
    frm_Propag.Top = 1620
    frm_System.Top = 2280
    lbl_2.Visible = OK
    txt_2.Visible = OK
    lbl_3.Visible = OK
    txt_3.Visible = OK
    lbl_4.Visible = OK
    txt_4.Visible = OK
    txt_2 = gs_TableCode6
    txt_3 = gs_TableCode8
    txt_4 = gs_TableCode10
    Select Case gut_Param.Str1
    Case "FireRes"
        If gs_TableCode12 = 0 Then
            cbo_Market.ListIndex = -1
        Else
            cbo_Market2.AddItem gs_TableCode12
            cbo_Market.AddItem gs_TableCode13
            cbo_Market.ListIndex = 0
        End If
        mb_MarketNotLoaded = OK
        cbo_Value2.AddItem gs_TableCode14
        cbo_Value.AddItem gs_TableCode15
        cbo_Value.ListIndex = 0
        mb_ValueNotLoaded = OK
        If gs_TableCode16 = "X" Then
            chk_Int.Value = 1
        End If
        txt_dropped = gs_TableCode17
    Case Else
        cbo_Value2.AddItem gs_TableCode12
        cbo_Value.AddItem gs_TableCode13
        cbo_Value.ListIndex = 0
        mb_ValueNotLoaded = OK
        If gs_TableCode14 = "X" Then
            chk_Int.Value = 1
        End If
        txt_dropped = gs_TableCode15
    End Select
Case "5"
    Me.Height = 3720
    frm_Value.Top = 1320
    frm_Propag.Top = 1800
    frm_System.Top = 2460
    lbl_2.Visible = OK
    txt_2.Visible = OK
    lbl_3.Visible = OK
    txt_3.Visible = OK
    lbl_4.Visible = OK
    txt_4.Visible = OK
    lbl_5.Visible = OK
    txt_5.Visible = OK
    txt_2 = gs_TableCode6
    txt_3 = gs_TableCode8
    txt_4 = gs_TableCode10
    txt_5 = gs_TableCode12
    cbo_Value2.AddItem gs_TableCode14
    cbo_Value.AddItem gs_TableCode15
    cbo_Value.ListIndex = 0
    mb_ValueNotLoaded = OK
    If gs_TableCode16 = "X" Then
        chk_Int.Value = 1
    End If
    txt_dropped = gs_TableCode17
End Select
opt_All.Value = OK
MouseOn
Exit Sub

suite:
StdError
End Sub

Private Sub spp_save_Click()

On Error GoTo suite

MouseOff
If Control Then
    gb_Return = OK
    If UpdTable Then
        Unload Me
        Exit Sub
    End If
End If
MouseOn
Exit Sub

suite:
StdError
End Sub
Private Sub SSC_dropped_Click()

On Error GoTo suite

MouseOff
gb_Return = KO
gs_Date = txt_dropped
Dates.show 1
If gb_Return Then
    txt_dropped = gs_Date
End If
MouseOn

Exit Sub

suite:
StdError
End Sub

Private Sub ssp_quit_Click()

MouseOff
Unload Me

End Sub
Private Function UpdTable() As Boolean

Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_value As String
Dim ls_IntFlag As String
Dim ls_DropFlag As String
Dim ls_DropDate As String
Dim ls_Propag As String

UpdTable = KO

On Error GoTo suite

ls_value = cbo_Value2.List(cbo_Value.ListIndex)
If chk_Int.Value = 1 Then
    ls_IntFlag = "X"
End If
If txt_dropped <> "" Then
    ls_DropFlag = "X"
    ls_DropDate = FormatD(txt_dropped, "mm/dd/yyyy")
End If
If opt_All Then
    ls_Propag = "1"
ElseIf opt_Dropped Then
    ls_Propag = "2"
Else
    ls_Propag = "3"
End If
Select Case gut_Param.Str11
Case "1"
    ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
        & gs_TableCode & "', '" _
        & gs_TableCode3 & "', " _
        & gs_TableCode5 & ", " _
        & gs_TableCode6 & ", " & ls_value & ", 0, '" _
        & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
        & ls_Propag
Case "2"
    Select Case gut_Param.Str1
    Case "AcoustAW", "AcoustNRC", "AbsClass", "EquivSoundAbs"
        ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
            & gs_TableCode & "', '" _
            & gs_TableCode3 & "', '" & gs_TableCode5 & "', " _
            & gs_TableCode7 & ", " _
            & gs_TableCode8 & ", " & cbo_Market2.List(cbo_Market.ListIndex) & ", " _
            & gs_TableCode10 & ", " & ls_value & ", " _
            & cbo_Curve2.List(cbo_Curve.ListIndex) & ", '" _
            & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
            & ls_Propag
    Case Else
        ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
            & gs_TableCode & "', '" _
            & gs_TableCode3 & "', '" & gs_TableCode5 & "', " _
            & gs_TableCode7 & ", " _
            & gs_TableCode8 & ", " & ls_value & ", 0, '" _
            & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
            & ls_Propag
    End Select
Case "3"
    Select Case gut_Param.Str1
    Case "FireReac"
        ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
            & gs_TableCode & "', '" _
            & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', " _
            & gs_TableCode9 & ", " _
            & gs_TableCode10 & ", " & cbo_Market2.List(cbo_Market.ListIndex) & ", " _
            & gs_TableCode12 & ", " & ls_value & ", 0, '" _
            & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
            & ls_Propag
    Case "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "RedInd", "Rain"
        ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
            & gs_TableCode & "', '" _
            & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', " _
            & gs_TableCode9 & ", " _
            & gs_TableCode10 & ", " & cbo_Market2.List(cbo_Market.ListIndex) & ", " _
            & gs_TableCode12 & ", " & ls_value & ", " _
            & cbo_Curve2.List(cbo_Curve.ListIndex) & ", '" _
            & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
            & ls_Propag
    Case Else
        ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
            & gs_TableCode & "', '" _
            & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', " _
            & gs_TableCode9 & ", " _
            & gs_TableCode10 & ", " & ls_value & ", 0, '" _
            & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
            & ls_Propag
    End Select
Case "4"
    Select Case gut_Param.Str1
    Case "FireRes"
        ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
            & gs_TableCode & "', '" _
            & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', '" _
            & gs_TableCode9 & "', " _
            & gs_TableCode11 & ", " _
            & gs_TableCode12 & ", " & cbo_Market2.List(cbo_Market.ListIndex) & ", " _
            & gs_TableCode14 & ", " & ls_value & ", 0, '" _
            & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
            & ls_Propag
    Case Else
        ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
            & gs_TableCode & "', '" _
            & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', '" _
            & gs_TableCode9 & "', " _
            & gs_TableCode11 & ", " _
            & gs_TableCode12 & ", " & ls_value & ", 0, '" _
            & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
            & ls_Propag
    End Select
Case "5"
    ls_req = "EXEC BI_" & gut_Param.Str1 & "_Value_upd '" _
        & gs_TableCode & "', '" _
        & gs_TableCode3 & "', '" & gs_TableCode5 & "', '" & gs_TableCode7 & "', '" _
        & gs_TableCode9 & "', '" & gs_TableCode11 & "', " _
        & gs_TableCode13 & ", " _
        & gs_TableCode14 & ", " & ls_value & ", 0, '" _
        & ls_IntFlag & "', '" & ls_DropFlag & "', '" & ls_DropDate & "', " _
        & ls_Propag
End Select
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    UpdTable = OK
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    C_main.FillGrid
Else
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    SendMessage 3, "Update failed", gut_LangLogin.Code
End If
Exit Function

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

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

On Error GoTo suite

ls_req = gut_Param.Str10
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If
Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Field = ODBCData(ll_Statement, 1)
        ls_Text = Left(ODBCData(ll_Statement, 2), 30)
        Select Case ls_Field
        Case "title": Caption = ls_Text
        Case "titleA": If gs_Action = "Add" Then Caption = Caption & " - " & ls_Text
        Case "titleU": If gs_Action = "Update" Then Caption = Caption & " - " & ls_Text
        Case "titleD": If gs_Action = "Delete" Then Caption = Caption & " - " & ls_Text
        Case "lbl_Category": lbl_Category.Caption = ls_Text
        Case "lbl_1": lbl_1 = ls_Text
        Case "lbl_2": lbl_2 = ls_Text
        Case "lbl_3": lbl_3 = ls_Text
        Case "lbl_4": lbl_4 = ls_Text
        Case "lbl_5": lbl_5 = ls_Text
        Case "lbl_Market": lbl_Market = ls_Text
        Case "lbl_Value": lbl_Value = ls_Text
        Case "lbl_int": lbl_Int = ls_Text
        Case "lbl_drop": lbl_Drop = ls_Text
        Case "frm_Propag": frm_Propag.Caption = ls_Text
        Case "opt_All": opt_All.Caption = ls_Text
        Case "opt_Dropped": opt_Dropped.Caption = ls_Text
        Case "opt_NonDropped": opt_NonDropped.Caption = ls_Text
        Case "lbl_Curve": lbl_Curve = ls_Text
        End Select
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

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

Control = KO
Select Case gut_Param.Str1
Case "FireReac", "FireRes"
    If cbo_Market.ListIndex = -1 Then
        cbo_Market.SetFocus
        SendMessage 8, "Value must be filled in", gut_LangLogin.Code
        Exit Function
    End If
Case "AcoustAW", "AcoustNRC", "AcoustDncW", "AcoustRW", "AcoustCAC", "Dnfw", "AbsClass", "RedInd", "Rain", "EquivSoundAbs"
    If cbo_Market.ListIndex = -1 Then
        cbo_Market.SetFocus
        SendMessage 8, "Value must be filled in", gut_LangLogin.Code
        Exit Function
    End If
    If cbo_Curve.ListIndex = -1 Then
        cbo_Curve.SetFocus
        SendMessage 8, "Value must be filled in", gut_LangLogin.Code
        Exit Function
    End If
End Select
If cbo_Value.ListIndex = -1 Then
    cbo_Value.SetFocus
    SendMessage 8, "Value must be filled in", gut_LangLogin.Code
    Exit Function
End If
Control = OK

End Function
