VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Claim_Coord 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   5580
   ClientLeft      =   870
   ClientTop       =   1245
   ClientWidth     =   7485
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   5580
   ScaleWidth      =   7485
   ShowInTaskbar   =   0   'False
   Begin VB.Frame frm_tabSO 
      Height          =   3615
      Index           =   1
      Left            =   120
      TabIndex        =   11
      Top             =   960
      Width           =   7215
      Begin VB.ListBox lst_MarketOut 
         Height          =   2205
         Left            =   480
         Sorted          =   -1  'True
         TabIndex        =   23
         Top             =   780
         Width           =   2004
      End
      Begin VB.ListBox lst_ToInsert 
         Height          =   645
         Left            =   2820
         Sorted          =   -1  'True
         TabIndex        =   22
         Top             =   360
         Visible         =   0   'False
         Width           =   1524
      End
      Begin VB.PictureBox pic_Out 
         AutoSize        =   -1  'True
         Height          =   408
         Left            =   3360
         ScaleHeight     =   345
         ScaleWidth      =   345
         TabIndex        =   21
         Top             =   2040
         Width           =   408
      End
      Begin VB.PictureBox pic_In 
         AutoSize        =   -1  'True
         Height          =   408
         Left            =   3360
         ScaleHeight     =   345
         ScaleWidth      =   345
         TabIndex        =   20
         Top             =   1320
         Width           =   408
      End
      Begin VB.ListBox lst_MarketIn 
         Height          =   2205
         Left            =   4680
         Sorted          =   -1  'True
         TabIndex        =   19
         Top             =   780
         Width           =   2004
      End
      Begin VB.ListBox lst_ToDelete 
         Height          =   645
         Left            =   2820
         Sorted          =   -1  'True
         TabIndex        =   18
         Top             =   2700
         Visible         =   0   'False
         Width           =   1524
      End
      Begin VB.Label lbl_Selected 
         Alignment       =   2  'Center
         Caption         =   "Selected"
         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            =   4680
         TabIndex        =   25
         Top             =   480
         Width           =   1995
      End
      Begin VB.Label lbl_Available 
         Alignment       =   2  'Center
         Caption         =   "Available"
         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            =   480
         TabIndex        =   24
         Top             =   480
         Width           =   1995
      End
   End
   Begin VB.Frame frm_tabSO 
      Height          =   3615
      Index           =   0
      Left            =   120
      TabIndex        =   10
      Top             =   1080
      Width           =   7215
      Begin VB.TextBox Txt_phone 
         Height          =   288
         Left            =   1680
         MaxLength       =   20
         TabIndex        =   14
         Top             =   840
         Width           =   2052
      End
      Begin VB.TextBox Txt_fax 
         Height          =   288
         Left            =   1680
         MaxLength       =   20
         TabIndex        =   13
         Top             =   1380
         Width           =   2052
      End
      Begin VB.TextBox Txt_info 
         Height          =   1152
         Left            =   240
         MaxLength       =   240
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   12
         Top             =   2160
         Width           =   6612
      End
      Begin VB.Label Lbl_phone 
         Caption         =   "Phone :"
         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            =   240
         TabIndex        =   17
         Top             =   840
         Width           =   1455
      End
      Begin VB.Label Lbl_fax 
         Caption         =   "Fax :"
         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            =   240
         TabIndex        =   16
         Top             =   1380
         Width           =   1455
      End
      Begin VB.Label Lbl_info 
         Caption         =   "Info"
         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            =   240
         TabIndex        =   15
         Top             =   1860
         Width           =   6495
      End
   End
   Begin MSComctlLib.TabStrip tbs_SalesOffice 
      Height          =   375
      Left            =   120
      TabIndex        =   9
      Top             =   600
      Width           =   7215
      _ExtentX        =   12726
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
         NumTabs         =   2
         BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Claim Coordinator"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Associate Sales Office"
            ImageVarType    =   2
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton spp_save 
      Default         =   -1  'True
      Height          =   612
      Left            =   5940
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   4800
      Width           =   612
   End
   Begin VB.CommandButton ssp_quit 
      Height          =   612
      Left            =   6600
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   4800
      Width           =   612
   End
   Begin VB.CommandButton SSC_dropped 
      Height          =   276
      Left            =   3180
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   5100
      Width           =   252
   End
   Begin VB.TextBox txt_dropped 
      ForeColor       =   &H00FF0000&
      Height          =   288
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   2
      Top             =   5100
      Width           =   1212
   End
   Begin VB.CheckBox chk_Int 
      Caption         =   "Check1"
      Height          =   252
      Left            =   1920
      TabIndex        =   1
      Top             =   4680
      Width           =   252
   End
   Begin VB.TextBox Txt_name 
      Height          =   288
      Left            =   1860
      MaxLength       =   60
      TabIndex        =   0
      Top             =   180
      Width           =   5352
   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          =   252
      Left            =   240
      TabIndex        =   8
      Top             =   4680
      Width           =   1452
   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          =   252
      Left            =   240
      TabIndex        =   7
      Top             =   5100
      Width           =   1452
   End
   Begin VB.Label Lbl_name 
      Caption         =   "Name :"
      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            =   180
      TabIndex        =   5
      Top             =   180
      Width           =   1632
   End
End
Attribute VB_Name = "Claim_Coord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim mi_concurrency As Integer
Dim ms_IntFlag As String



Private Sub Form_Load()
Dim ls_Req As String

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)
pic_In.Picture = LoadResPicture(RES_RIGHT, 1)
pic_Out.Picture = LoadResPicture(RES_LEFT, 1)
SSC_dropped.Picture = LoadResPicture(RES_DOWN2, vbResIcon)
    
    ' NEW 22.1.2005 remove SSTab begin
    Call InitTabStrip(tbs_SalesOffice, frm_tabSO)
    ' NEW 22.1.2005 remove SSTab end

GetConstants
Select Case gs_Action
Case "Add"
'    tab_SalesOffice.TabVisible(1) = KO
    tbs_SalesOffice.Tabs.Remove ("_1")      ' NEW 22.1.2005 remove SSTab
Case "Update"
    Set_Description
    ls_Req = "EXEC Claim_CoordinatorIn_cbo " _
        & gs_TableCode & ", '" _
        & gut_LangWork.Code & "'"
    FillLstSingle ls_Req, lst_MarketIn
    ls_Req = "EXEC Claim_CoordinatorOut_cbo " _
        & gs_TableCode & ", '" _
        & gut_LangWork.Code & "'"
    FillLstSingle ls_Req, lst_MarketOut
Case "Delete"
    Set_Description
'    tab_SalesOffice.TabVisible(1) = KO
    tbs_SalesOffice.Tabs.Remove ("_1")      ' NEW 22.1.2005 remove SSTab
    Txt_name.Enabled = KO
    Txt_phone.Enabled = KO
    Txt_fax.Enabled = KO
    Txt_info.Enabled = KO
    SSC_dropped.Visible = KO
    chk_Int.Enabled = KO
Case "MoreInfo"
    Set_Description
    ls_Req = "EXEC Claim_CoordinatorIn_cbo " _
        & gs_TableCode & ", '" _
        & gut_LangWork.Code & "'"
    FillLstSingle ls_Req, lst_MarketIn
    ls_Req = "EXEC Claim_CoordinatorOut_cbo " _
        & gs_TableCode & ", '" _
        & gut_LangWork.Code & "'"
    FillLstSingle ls_Req, lst_MarketOut
    Txt_name.Locked = OK
    Txt_info.Locked = OK
    Txt_fax.Locked = OK
    Txt_phone.Locked = OK
    SSC_dropped.Visible = KO
    chk_Int.Enabled = KO
    spp_save.Visible = KO
    pic_In.Enabled = KO
    pic_Out.Enabled = KO
End Select
    
    ' NEW 22.1.2005 remove SSTab begin
    Call SetTabStripVisible(tbs_SalesOffice, frm_tabSO, True)
    ' NEW 22.1.2005 remove SSTab end


MouseOn
Exit Sub

suite:
StdError
End Sub

Private Sub pic_In_Click()

If lst_MarketOut.ListIndex <> -1 Then
    If Not RemoveItemLst(lst_ToDelete, lst_MarketOut.Text) Then
        lst_ToInsert.AddItem lst_MarketOut.Text
    End If
    lst_MarketIn.AddItem lst_MarketOut.Text
    lst_MarketOut.RemoveItem lst_MarketOut.ListIndex
End If

End Sub

Private Sub pic_Out_Click()

If lst_MarketIn.ListIndex <> -1 Then
    If Not RemoveItemLst(lst_ToInsert, lst_MarketIn.Text) Then
        lst_ToDelete.AddItem lst_MarketIn.Text
    End If
    lst_MarketOut.AddItem lst_MarketIn.Text
    lst_MarketIn.RemoveItem lst_MarketIn.ListIndex
End If

End Sub


Private Sub spp_save_Click()

Dim ls_Line As String

MouseOff
gb_Return = OK
On Error GoTo suite

Select Case gs_Action
Case "Add"
    If Add_Table Then
        Txt_name = ""
        Txt_phone = ""
        Txt_fax = ""
        Txt_info = ""
        txt_dropped = ""
        chk_Int.value = 0
        Txt_name.SetFocus
        If gl_NbLineDisplay < 2 Then
            C_main.FillGrid
        End If
    End If
Case "Update"
    If Control Then
        If BeginTran(gl_Environment, gl_Database) Then
            If Upd_Table Then
                If CommitTran(gl_Environment, gl_Database) Then
                    C_main.Grid.RemoveItem C_main.Grid.Row
                    ls_Line = gs_TableCode & Chr(9) & Txt_name & Chr(9) & Txt_phone & Chr(9) & Txt_fax & Chr(9) & ms_IntFlag & Chr(9) & txt_dropped
                    C_main.Grid.AddItem ls_Line, C_main.Grid.Row
                    Unload Me
                Else
                    RollbackTran gl_Environment, gl_Database
                    SendMessage 3, "Update failed", gut_LangLogin.Code
                End If
            Else
                RollbackTran gl_Environment, gl_Database
                SendMessage 3, "Update failed", gut_LangLogin.Code
            End If
        Else
            SendMessage 3, "Update failed", gut_LangLogin.Code
        End If
    End If
Case "Delete"
    If Dlt_Table Then
        Unload Me
    End If
End Select
MouseOn
Exit Sub

suite:
Select Case Err
Case 30015
    C_main.FillGrid
    Unload Me
Case Else
    StdError
    MouseOn
End Select
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 Sub Set_Description()
Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Field As String
Dim ls_Field2 As String
Dim li_Count As Integer

On Error GoTo suite

ls_Req = "EXEC Claim_Coordinator_dtl " & gs_TableCode & ",'" & gut_LangWork.Code & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        Txt_name = ODBCData(ll_Statement, 1)
        Txt_phone = ODBCData(ll_Statement, 2)
        Txt_fax = ODBCData(ll_Statement, 3)
        Txt_info = ODBCData(ll_Statement, 4)
        If ODBCData(ll_Statement, 5) = "X" Then
            chk_Int.value = 1
        End If
        txt_dropped = ODBCData(ll_Statement, 6)
        mi_concurrency = ODBCData(ll_Statement, 7)
    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 Function Upd_Table() As Boolean

Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ll_lngrows As Long
Dim ls_Line As String
Dim ls_IntFlag As String
Dim ls_DropFlag As String
Dim ls_DropDate As String
Dim li_Count As Integer

Upd_Table = KO

On Error GoTo suite

If chk_Int.value = 1 Then ls_IntFlag = "X"
If txt_dropped <> "" Then
    ls_DropFlag = "X"
    ls_DropDate = FormatD(txt_dropped, "mm/dd/yyyy")
End If
ls_Req = "EXEC Claim_Coordinator_upd " _
    & gs_TableCode & ", '" _
    & QuoteParam(Txt_name) & "', '" _
    & QuoteParam(Txt_phone) & "', '" _
    & QuoteParam(Txt_fax) & "', '" _
    & QuoteParam(Txt_info) & "', " _
    & mi_concurrency & ",'" _
    & ls_IntFlag & "','" _
    & ls_DropFlag & "','" _
    & ls_DropDate & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
    li_Status = SQLRowCount(ll_Statement, ll_lngrows)
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    If ll_lngrows = 0 Then
        SendMessage 2, "Another user change the record", gut_LangLogin.Code
        C_main.FillGrid
    End If
Else
    SendMessage 3, "Update failed", gut_LangLogin.Code
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
End If
For li_Count = 0 To lst_ToInsert.ListCount - 1
    ls_Req = "EXEC Claim_Coordinator_Link_Ins " _
        & gs_TableCode & ", '" _
        & gut_LangWork.Code & "', '" _
        & lst_ToInsert.List(li_Count) & "'"
    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 3, "Update failed", gut_LangLogin.Code
            Exit Function
        End If
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        SendMessage 3, "Update failed", gut_LangLogin.Code
        Exit Function
    End If
Next li_Count
For li_Count = 0 To lst_ToDelete.ListCount - 1
    ls_Req = "EXEC Claim_Coordinator_Link_Del " _
        & gs_TableCode & ", '" _
        & gut_LangWork.Code & "', '" _
        & lst_ToDelete.List(li_Count) & "'"
    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 3, "Update failed", gut_LangLogin.Code
            Exit Function
        End If
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        SendMessage 3, "Update failed", gut_LangLogin.Code
        Exit Function
    End If
Next li_Count
Upd_Table = OK
Exit Function

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

Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ll_lngrows As Long
Dim ls_Line As String
Dim ls_DropFlag As String
Dim ls_DropDate As String

Add_Table = KO

On Error GoTo suite

If Control Then
    If chk_Int.value = 1 Then ms_IntFlag = "X"
    If txt_dropped <> "" Then
        ls_DropFlag = "X"
        ls_DropDate = FormatD(txt_dropped, "mm/dd/yyyy")
    End If
    ls_Req = "EXEC Claim_Coordinator_ins '" _
        & QuoteParam(Txt_name) & "', '" _
        & QuoteParam(Txt_phone) & "', '" _
        & QuoteParam(Txt_fax) & "', '" _
        & QuoteParam(Txt_info) & "','" _
        & ms_IntFlag & "','" _
        & ls_DropFlag & "','" _
        & ls_DropDate & "'"
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQLRowCount(ll_Statement, ll_lngrows)
        If ll_lngrows = 0 Then
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
            SendMessage 4, "Insert failed", gut_LangLogin.Code
            C_main.FillGrid
        Else
            li_Status = SQLFetch(ll_Statement)
            If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
                Add_Table = OK
                ls_Line = ODBCData(ll_Statement, 1) & Chr(9) & Txt_name & Chr(9) & ms_IntFlag & Chr(9) & txt_dropped
                li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
                C_main.Grid.AddItem ls_Line
                C_main.Grid.Row = C_main.Grid.Rows - 1
            Else
                li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
                SendMessage 4, "Insert failed", gut_LangLogin.Code
                Exit Function
            End If
        End If
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        SendMessage 4, "Insert failed", gut_LangLogin.Code
    End If
End If
Exit Function

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

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

Dlt_Table = KO

On Error GoTo suite

MouseOn
If SendMessage(5, "Delete record ?", gut_LangLogin.Code, vbQuestion + vbYesNo, "Delete ") = vbYes Then
    MouseOff
    ls_Req = "EXEC Claim_Coordinator_del " & gs_TableCode & ", " & mi_concurrency
    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 GetConstants()
Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Field As String, ls_Text As String

ls_Req = "EXEC Screen_Csts mtnc_ClaimCoord, '" & gut_LangLogin.Code & "'"

On Error GoTo suite
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 "titleI": If gs_Action = "MoreInfo" Then Caption = Caption & " - " & ls_Text
        Case "lbl_name": Lbl_name = ls_Text
        Case "lbl_phone": Lbl_phone.Caption = ls_Text
        Case "lbl_fax": Lbl_fax = ls_Text
        Case "lbl_info": Lbl_info = ls_Text
        Case "lbl_int": lbl_Int = ls_Text
        Case "lbl_drop": lbl_Drop = ls_Text
        Case "tab_SO(0)": tbs_SalesOffice.Tabs("_0").Caption = ls_Text
        Case "tab_SO(1)": tbs_SalesOffice.Tabs("_1").Caption = ls_Text
        Case "lbl_available": lbl_Available = ls_Text
        Case "lbl_selected": lbl_Selected = 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() As Boolean

Control = KO
If Txt_name.Text = "" Then
    Txt_name.SetFocus
    SendMessage 8, "Value must be filled in", gut_LangLogin.Code
    Exit Function
End If
If Len(Txt_name) < 4 Then
    Txt_name.SetFocus
    SendMessage 11, "Value must be more than 3 characters long", gut_LangLogin.Code
    Exit Function
End If
If Txt_phone = "" Then
    Txt_phone.SetFocus
    SendMessage 8, "Value must be filled in", gut_LangLogin.Code
    Exit Function
End If
Control = OK

End Function


' NEW 23.1.2005 remove SSTab begin
Private Sub InitTabStrip(ByVal ao_tbStrip As MSComctlLib.TabStrip, ByRef ao_tabs As Object)
Dim lo_Object As Object
    For Each lo_Object In ao_tabs
        Select Case ao_tbStrip.Placement
            Case tabPlacementLeft
                Call lo_Object.Move(ao_tbStrip.left + ao_tbStrip.Width, ao_tbStrip.top)
            Case tabPlacementTop
                Call lo_Object.Move(ao_tbStrip.left, ao_tbStrip.top + ao_tbStrip.Height)
            Case tabPlacementRight
                Call lo_Object.Move(ao_tbStrip.left - lo_Object.Width, ao_tbStrip.top)
            Case tabPlacementBottom
                Call lo_Object.Move(ao_tbStrip.left, ao_tbStrip.top - lo_Object.Height)
        End Select
    Next
    
    For Each lo_Object In ao_tbStrip.Tabs
        lo_Object.Key = "_" & lo_Object.Index - 1
    Next
End Sub

Private Sub UpdateTabStrip(ByVal ao_tbStrip As MSComctlLib.TabStrip, ByRef ao_tabs As Object)
Dim lo_Object As Object
    For Each lo_Object In ao_tabs
        lo_Object.Visible = (lo_Object.Index = CLng(Mid(ao_tbStrip.SelectedItem.Key, 2)))
    Next
End Sub

Private Sub SetTabStripVisible(ByRef ao_tbStrip As MSComctlLib.TabStrip, ByRef ao_tabs As Object, ByVal ab_Visible As Boolean)
    ao_tbStrip.Visible = ab_Visible

    If ab_Visible Then
        Call UpdateTabStrip(ao_tbStrip, ao_tabs)
    Else
        Dim lo_Object As Object
        ' hide all tabs
        For Each lo_Object In ao_tabs
            lo_Object.Visible = False
        Next
    End If
End Sub

Private Sub tbs_SalesOffice_Click()
    MouseOff
    Call UpdateTabStrip(tbs_SalesOffice, frm_tabSO)
    MouseOn
End Sub
' NEW 23.1.2005 remove SSTab end

