VERSION 5.00
Object = "{0F987290-56EE-11D0-9C43-00A0C90F29FC}#1.0#0"; "ActBar.ocx"
Object = "{CDF3B183-D408-11CE-AE2C-0080C786E37D}#2.1#0"; "Edt32x20.ocx"
Object = "{9FE8BEE1-8569-4532-8518-BB32F08FC1EB}#2.0#0"; "dtF4.ocx"
Begin VB.Form FCO5010A 
   Caption         =   "Alta Proceso Reportes"
   ClientHeight    =   3465
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4380
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "ProcesoReportes_A.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3465
   ScaleWidth      =   4380
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame fraFrame 
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2295
      Left            =   360
      TabIndex        =   13
      Top             =   240
      Width           =   3615
      Begin EditLib.fpLongInteger txtMes 
         Height          =   285
         Left            =   1560
         TabIndex        =   12
         Top             =   1440
         Width           =   975
         _Version        =   131073
         _ExtentX        =   1720
         _ExtentY        =   503
         _StockProps     =   68
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         ThreeDInsideStyle=   1
         ThreeDInsideHighlightColor=   -2147483633
         ThreeDInsideShadowColor=   -2147483642
         ThreeDInsideWidth=   1
         ThreeDOutsideStyle=   1
         ThreeDOutsideHighlightColor=   16777215
         ThreeDOutsideShadowColor=   -2147483632
         ThreeDOutsideWidth=   1
         ThreeDFrameWidth=   0
         BorderStyle     =   0
         BorderColor     =   -2147483642
         BorderWidth     =   1
         ButtonDisable   =   0   'False
         ButtonHide      =   0   'False
         ButtonIncrement =   1
         ButtonMin       =   1
         ButtonMax       =   100
         ButtonStyle     =   1
         ButtonWidth     =   0
         ButtonWrap      =   -1  'True
         ButtonDefaultAction=   -1  'True
         ThreeDText      =   0
         ThreeDTextHighlightColor=   -2147483633
         ThreeDTextShadowColor=   -2147483632
         ThreeDTextOffset=   1
         AlignTextH      =   2
         AlignTextV      =   1
         AllowNull       =   0   'False
         NoSpecialKeys   =   3
         AutoAdvance     =   0   'False
         AutoBeep        =   0   'False
         CaretInsert     =   0
         CaretOverWrite  =   3
         UserEntry       =   0
         HideSelection   =   -1  'True
         InvalidColor    =   -2147483637
         InvalidOption   =   0
         MarginLeft      =   3
         MarginTop       =   3
         MarginRight     =   3
         MarginBottom    =   3
         NullColor       =   -2147483637
         OnFocusAlignH   =   0
         OnFocusAlignV   =   0
         OnFocusNoSelect =   0   'False
         OnFocusPosition =   0
         ControlType     =   0
         Text            =   "0"
         MaxValue        =   "12"
         MinValue        =   "1"
         NegFormat       =   1
         NegToggle       =   0   'False
         Separator       =   ""
         UseSeparator    =   0   'False
         IncInt          =   1
         BorderGrayAreaColor=   -2147483637
         ThreeDOnFocusInvert=   0   'False
         ThreeDFrameColor=   -2147483633
         Appearance      =   0
         BorderDropShadow=   0
         BorderDropShadowColor=   -2147483632
         BorderDropShadowWidth=   3
         MouseIcon       =   "ProcesoReportes_A.frx":030A
      End
      Begin EditLib.fpLongInteger txtAño 
         Height          =   285
         Left            =   1560
         TabIndex        =   10
         Top             =   1080
         Width           =   975
         _Version        =   131073
         _ExtentX        =   1720
         _ExtentY        =   503
         _StockProps     =   68
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         ThreeDInsideStyle=   1
         ThreeDInsideHighlightColor=   -2147483633
         ThreeDInsideShadowColor=   -2147483642
         ThreeDInsideWidth=   1
         ThreeDOutsideStyle=   1
         ThreeDOutsideHighlightColor=   16777215
         ThreeDOutsideShadowColor=   -2147483632
         ThreeDOutsideWidth=   1
         ThreeDFrameWidth=   0
         BorderStyle     =   0
         BorderColor     =   -2147483642
         BorderWidth     =   1
         ButtonDisable   =   0   'False
         ButtonHide      =   0   'False
         ButtonIncrement =   1
         ButtonMin       =   1
         ButtonMax       =   100
         ButtonStyle     =   1
         ButtonWidth     =   0
         ButtonWrap      =   -1  'True
         ButtonDefaultAction=   -1  'True
         ThreeDText      =   0
         ThreeDTextHighlightColor=   -2147483633
         ThreeDTextShadowColor=   -2147483632
         ThreeDTextOffset=   1
         AlignTextH      =   2
         AlignTextV      =   1
         AllowNull       =   0   'False
         NoSpecialKeys   =   3
         AutoAdvance     =   0   'False
         AutoBeep        =   0   'False
         CaretInsert     =   0
         CaretOverWrite  =   3
         UserEntry       =   0
         HideSelection   =   -1  'True
         InvalidColor    =   -2147483637
         InvalidOption   =   0
         MarginLeft      =   3
         MarginTop       =   3
         MarginRight     =   3
         MarginBottom    =   3
         NullColor       =   -2147483637
         OnFocusAlignH   =   0
         OnFocusAlignV   =   0
         OnFocusNoSelect =   0   'False
         OnFocusPosition =   0
         ControlType     =   0
         Text            =   "0"
         MaxValue        =   "2078"
         MinValue        =   "2002"
         NegFormat       =   1
         NegToggle       =   0   'False
         Separator       =   ""
         UseSeparator    =   0   'False
         IncInt          =   1
         BorderGrayAreaColor=   -2147483637
         ThreeDOnFocusInvert=   0   'False
         ThreeDFrameColor=   -2147483633
         Appearance      =   0
         BorderDropShadow=   0
         BorderDropShadowColor=   -2147483632
         BorderDropShadowWidth=   3
         MouseIcon       =   "ProcesoReportes_A.frx":0326
      End
      Begin DataTec_F4.dtF4 dtF4Reporte 
         Height          =   255
         Left            =   2640
         TabIndex        =   2
         Top             =   0
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   450
      End
      Begin VB.TextBox txtCod 
         Height          =   285
         Left            =   1560
         MaxLength       =   4
         TabIndex        =   1
         Top             =   0
         Width           =   975
      End
      Begin VB.TextBox txtEPSFPO 
         Height          =   285
         Left            =   1560
         MaxLength       =   10
         TabIndex        =   4
         Top             =   360
         Width           =   975
      End
      Begin VB.TextBox txtSUC 
         Height          =   285
         Left            =   1560
         MaxLength       =   10
         TabIndex        =   7
         Top             =   720
         Width           =   975
      End
      Begin DataTec_F4.dtF4 dtF4Adm 
         Height          =   255
         Left            =   2640
         TabIndex        =   5
         Top             =   360
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   450
      End
      Begin DataTec_F4.dtF4 dtF4Suc 
         Height          =   255
         Left            =   2640
         TabIndex        =   8
         Top             =   720
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   450
      End
      Begin VB.Label lblValidando 
         Alignment       =   1  'Right Justify
         BackStyle       =   0  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1680
         TabIndex        =   14
         Top             =   1920
         Width           =   1935
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "&Reporte"
         Height          =   210
         Index           =   0
         Left            =   480
         TabIndex        =   0
         Top             =   0
         Width           =   570
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "&EPS / FPO"
         Height          =   210
         Index           =   1
         Left            =   480
         TabIndex        =   3
         Top             =   360
         Width           =   720
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "&Sucursal"
         Height          =   210
         Index           =   2
         Left            =   480
         TabIndex        =   6
         Top             =   720
         Width           =   645
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "&Año"
         Height          =   210
         Index           =   3
         Left            =   480
         TabIndex        =   9
         Top             =   1080
         Width           =   300
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "&Mes"
         Height          =   210
         Index           =   4
         Left            =   480
         TabIndex        =   11
         Top             =   1440
         Width           =   300
      End
   End
   Begin ActiveBarLibraryCtl.ActiveBar abToolbar 
      Left            =   60
      Top             =   2670
      _ExtentX        =   847
      _ExtentY        =   847
      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
      Bands           =   "ProcesoReportes_A.frx":0342
   End
End
Attribute VB_Name = "FCO5010A"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Mado As ODBC.ODBCDirecto
Private MiCx As Integer 'Conexión
Private MiX As Integer 'Ancho de la forma
Private MiY As Integer 'Alta de la forma

Private MBCambio As Boolean
Private MsCodAgrEPS As String
Private MsCodAgrFPO As String
Private MsCodAgrSUC As String
Private MbManEPS As Boolean
Private MbManFPO As Boolean
Private MbManISS As Boolean
Private MbManARP As Boolean
Private MbManSUC As Boolean
Private MbRepValido As Boolean
Private MbAGRValido As Boolean
Private MbSucValida As Boolean

Private Sub abToolbar_Click(ByVal Tool As ActiveBarLibraryCtl.Tool)
    Select Case LCase(Tool.Name)
        Case "tlguarda"
            If bValidarDatos Then
                GuardaCambios
                If MbRepValido And MbAGRValido Then Unload Me
            End If
        Case "tlsalida"
            Unload Me
    End Select
End Sub

Private Sub dtF4Adm_Click()
    If MbManISS Or MbManARP Then Exit Sub
    Screen.MousePointer = vbHourglass
    GsParamIN(0) = "SELECT codigo, descripcion FROM vw_fco_administradoras WHERE compania = '" & GsCveCia & "' AND tipo IN ('" & IIf(MbManEPS, "EPS", "-") & "','" & IIf(MbManFPO, "AFP", "-") & "')"
    GsParamIN(1) = "codigo"
    GsParamIN(2) = "descripcion"
    GsParamIN(3) = "Codigo"
    GsParamIN(4) = "Nombre"
    GsParamIN(5) = "Administradora"
    GsParamIN(6) = ""
    frmLista.Show 1
    txtEPSFPO = GsParamOUT(0)
    If Trim(txtEPSFPO) <> "" Then
        MBCambio = True
        SendEnter
        SendEnter
    End If
End Sub

Private Sub dtF4Reporte_Click()
    Dim Lista As New cdtLista
    Screen.MousePointer = vbHourglass
    Lista.Sql = "SELECT codigo, nombre FROM fco_reportes_ala WHERE 1=1"
    Lista.Campo1 = "codigo"
    Lista.Campo2 = "nombre"
    Lista.Titulo1 = "Codigo"
    Lista.Titulo2 = "Nombre Reporte"
    Lista.TituloVentana = "Reportes"
    Lista.Orden = ""
    Lista.MostrarLista
    If Trim(Lista.Valor1) <> "" Then
        txtCod = Lista.Valor1
        MBCambio = True
        HallarQueManeja
        MbRepValido = True
        SendEnter
        SendEnter
    End If
    Set Lista = Nothing
End Sub

Private Sub dtF4Suc_Click()
    Screen.MousePointer = vbHourglass
    GsParamIN(0) = "SELECT sucursal, descripcion" & _
    " FROM vw_fco_sucursales" & _
    " WHERE compania='" & GsCveCia & "'" & _
    " AND autoliquida = 1"
    GsParamIN(1) = "sucursal"
    GsParamIN(2) = "descripcion"
    GsParamIN(3) = "Codigo"
    GsParamIN(4) = "Nombre"
    GsParamIN(5) = "Sucursal"
    GsParamIN(6) = ""
    frmLista.Show 1
    txtSUC = GsParamOUT(0)
    If Trim(txtSUC) <> "" Then
        MBCambio = True
        MbSucValida = True
        SendEnter
        SendEnter
    End If
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyF3: Unload Me
        Case vbKeyF4
            If LCase(ActiveControl.Name) = "txtcod" Then
                dtF4Reporte_Click
            ElseIf LCase(ActiveControl.Name) = "txtepsfpo" Then
                dtF4Adm_Click
            Else
                dtF4Suc_Click
            End If
         Case vbKeyF11: GuardaCambios
    End Select
End Sub

Private Sub Form_Load()
    GbAError = False
    Me.Tag = GiVenMax%
    Gven(Val(Me.Tag)).icx = Gicx%
    MiCx = Gven(Val(Me.Tag)).icx
    Set Mado = Gtc(MiCx).Ado
    Me.Icon = LoadPicture(sIconoForma)
        
    If Not MDIChild Then
        WindowState = 0
        Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
        Screen.MousePointer = vbDefault
    End If
    
    'Tamaño de la forma
    If Me.WindowState = 0 Then
        MiX = 4500
        MiY = 3870
        Me.Width = MiX
        Me.Height = MiY
    End If

    Caption = GsDsn & " / " & GsCveCia & " - Alta de Reportes y Medios Magnéticos"
    AsignaIconos abToolbar, 3, LGUARDA, LSALIDA
    MbManEPS = False
    MbManFPO = False
    MbManISS = False
    MbManARP = False
    MbManSUC = False
    MbRepValido = False
    MbAGRValido = False
    MbSucValida = False
    
    MsCodAgrEPS = sRecuperarParamALA(Mado, 21)
    MsCodAgrFPO = sRecuperarParamALA(Mado, 22)
    MsCodAgrSUC = sRecuperarParamALA(Mado, 23)
    
    txtAño = IIf(Month(Date) = 12, Year(Date) - 1, Year(Date))
    txtMes = IIf(Month(Date) = 1, 12, Month(Date) - 1)
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If MBCambio Then
        If clsMsgbox.Mensaje("¿Desea guardar los cambios?", mSiNoCancelar, mConfirma, GsTitMsg) = vbYes Then
            If bValidarDatos Then
                GuardaCambios
                If MbRepValido And MbAGRValido And IIf(MbManSUC, MbSucValida, True) Then
                    Unload Me
                Else
                    Cancel = 1
                End If
            Else
                Cancel = 1
            End If
        End If
    End If
End Sub

Private Function bValidarDatos() As Boolean
    Dim sMensaje As String
    
    bValidarDatos = True
    If Trim(txtMes) = "" Then bValidarDatos = False: sMensaje = "el Mes"
    If bValidarDatos Then If Trim(txtAño) = "" Then bValidarDatos = False: sMensaje = "el Año"
    If Len(txtAño) <> 4 Then
        clsMsgbox.Mensaje "Digite el año completo", mAceptar, mAdvierte, GsTitMsg
        txtAño.SetFocus
        bValidarDatos = False
        Exit Function
    End If
    If Val(txtMes) < 1 Or Val(txtMes) > 12 Then
        clsMsgbox.Mensaje "El mes digitado no existe", mAceptar, mAdvierte, GsTitMsg
        txtMes.SetFocus
        bValidarDatos = False
        Exit Function
    End If
    If Not bValidarDatos Then clsMsgbox.Mensaje "Antes de guardar debe definir " & sMensaje, mAceptar, mAdvierte, GsTitMsg

End Function

Private Sub GuardaCambios()
    On Error GoTo AclararError
    If Not MbRepValido Then ValidarReporte
    If Not MbRepValido Then txtCod.SetFocus: Exit Sub
    If Not MbAGRValido Then ValidarEPSFPO
    If Not MbAGRValido Then txtEPSFPO.SetFocus: Exit Sub
    If MbManSUC Then
        If Trim(txtSUC) = "" Then MbSucValida = True
        If Not MbSucValida Then ValidarSucursal
        If Not MbSucValida Then txtSUC.SetFocus: Exit Sub
    End If

    Mado.Sql = "sp_fco_alta_proc_reportes_ala " & _
    "'" & GsCveCia & "'," & _
    "'" & Trim(txtCod) & "'," & _
    "'" & Trim(Val(txtAño)) & "'," & _
    "'" & Trim(Val(txtMes)) & "'," & _
    "'" & Trim(txtEPSFPO) & "'," & _
    "'" & Trim(txtSUC) & "'"
    
    If Mado.ExecSQL = -1 Then GoTo AclararError
    
    GsAño = txtAño
    GsMes = txtMes
    MBCambio = False
    Exit Sub
AclararError:
    Screen.MousePointer = vbDefault
    If Err > 0 Then
        clsMsgbox.Mensaje Err.Description, mAceptar, mAdvierte, GsTitMsg
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set Mado = Nothing
    Gtc(MiCx).ihijas = Gtc(MiCx).ihijas - 1
    Set FCO5010A = Nothing

End Sub

Private Sub txtAño_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
        KeyAscii = 0
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtCod_Change()
    MbRepValido = False
End Sub

Private Sub txtCod_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        If Not (MbRepValido) Then ValidarReporte
        If MbRepValido Then SendEnter: SendEnter
        KeyAscii = 0
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

Private Sub txtEPSFPO_Change()
    MbAGRValido = False
End Sub

Private Sub txtEPSFPO_GotFocus()
    If MbRepValido = False Then ValidarReporte
End Sub

Private Sub txtEPSFPO_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
        SendEnter
        KeyAscii = 0
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

Private Sub txtMes_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        Unload Me
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtMes_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyUp Then txtAño.SetFocus
End Sub

Private Sub txtSuc_Change()
    MbSucValida = False
End Sub

Private Sub txtSUC_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        If Not (MbSucValida) Then ValidarSucursal
        If MbSucValida Or Trim(txtSUC) = "" Then SendEnter: SendEnter
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

Private Sub HallarQueManeja()
    Dim sSql As String
    
    sSql = "SELECT Maneja_EPS, Maneja_FPO, Maneja_SUC, Maneja_ARP, Maneja_ISS" & _
    " FROM fco_Reportes_ALA WHERE Codigo='" & txtCod & "'"
    Mado.Sql = sSql
    Mado.SendSQL
    If Not Mado.EOF Then
        MbManEPS = (Val("" & Mado.GetField(1)) = 1)
        MbManFPO = (Val("" & Mado.GetField(2)) = 1)
        MbManISS = (Val("" & Mado.GetField(5)) = 1)
        MbManARP = (Val("" & Mado.GetField(4)) = 1)
        MbManSUC = (Val("" & Mado.GetField(3)) = 1)
    End If

    txtEPSFPO = ""
    lblLabels(1).Enabled = Not (MbManARP Or MbManISS)
    txtEPSFPO.Enabled = Not (MbManARP Or MbManISS)
    dtF4Adm.Visible = Not (MbManARP Or MbManISS)
    lblLabels(2).Enabled = MbManSUC
    txtSUC.Enabled = MbManSUC
    dtF4Suc.Visible = MbManSUC
    If MbManEPS Then lblLabels(1) = "&EPS"
    If MbManFPO Then lblLabels(1) = "&FPO"
    If MbManARP Then
        lblLabels(1) = "ARP"
        txtEPSFPO = "ARP"
        MbAGRValido = True
    End If
    If MbManISS Then
        lblLabels(1) = "ISS"
        txtEPSFPO = "ISS"
        MbAGRValido = True
    End If
End Sub

Private Sub ValidarEPSFPO()
    Dim sSql As String
    Dim SCond As String
    Dim SMens As String
    
    If Trim(txtEPSFPO) = "" Or MbManISS Or MbManARP Then MbAGRValido = True
    If MbAGRValido Then Exit Sub
    Screen.MousePointer = vbHourglass

    If MbManEPS And Not MbManFPO Then SCond = "='" & MsCodAgrEPS & "'": SMens = "La EPS"
    If MbManFPO And Not MbManEPS Then SCond = "='" & MsCodAgrFPO & "'": SMens = "La FPO"
    
    sSql = " SELECT dato FROM datos_agr_trab" & _
    " WHERE agrupacion " & SCond & _
    " And rtrim(ltrim(dato))='" & Trim(txtEPSFPO) & "'"
    Mado.Sql = sSql
    Mado.SendSQL

    If Mado.EOF Then
        Screen.MousePointer = vbDefault
        clsMsgbox.Mensaje "No existe " & SMens, mAceptar, mAdvierte, GsTitMsg
        MbAGRValido = False
        Exit Sub
    Else
        txtEPSFPO = Mado.GetField(1)
        MbAGRValido = True
    End If
    
    MBCambio = True
    Screen.MousePointer = vbDefault
End Sub

Private Sub ValidarReporte()
    Dim sSql As String
        
    lblValidando = "Validando el reporte..."
    DoEvents
    Screen.MousePointer = vbHourglass
    sSql = " SELECT codigo, nombre" & _
    " FROM fco_Reportes_ALA" & _
    " WHERE ltrim(rtrim(codigo))='" & Trim(txtCod) & "'"
    Mado.Sql = sSql
    Mado.SendSQL
    
    If Mado.EOF Then
        Screen.MousePointer = vbDefault
        txtCod.SetFocus
        lblValidando = ""
        clsMsgbox.Mensaje "No existe el reporte", mAceptar, mAdvierte, GsTitMsg
        MbRepValido = False
        Exit Sub
    Else
        txtCod = Mado.GetField(1)
        MbRepValido = True
    End If
    MBCambio = True
    HallarQueManeja
    Screen.MousePointer = vbDefault
    lblValidando = ""
End Sub

Private Sub ValidarSucursal()
    If Trim(txtSUC) = "" Then Exit Sub
    Mado.Sql = _
    " SELECT sucursal, descripcion FROM vw_fco_sucursales" & _
    " WHERE compania = '" & GsCveCia & "'" & _
    "  And RTrim(sucursal) ='" & RTrim(txtSUC) & "'"
    Mado.SendSQL
    If Mado.EOF Then
        Screen.MousePointer = vbDefault
        clsMsgbox.Mensaje "No existe la sucursal", mAceptar, mAdvierte, GsTitMsg
        Exit Sub
    Else
        txtSUC = Mado.GetField(1)
        MbSucValida = True
    End If
    MBCambio = True
End Sub
