VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form_Contrato_linea 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Detalle de Linea"
   ClientHeight    =   5850
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   9675
   LinkTopic       =   "Form4"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   5850
   ScaleWidth      =   9675
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame4 
      Caption         =   "Nueva Linea"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   5535
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   9375
      Begin VB.CommandButton Command5 
         Caption         =   "&Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   7560
         TabIndex        =   3
         Top             =   4920
         Width           =   1695
      End
      Begin VB.CommandButton Command4 
         Caption         =   "&Aceptar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   120
         TabIndex        =   2
         Top             =   4920
         Width           =   1695
      End
      Begin VB.TextBox txt_linea 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3975
         Left            =   120
         MultiLine       =   -1  'True
         TabIndex        =   1
         Top             =   840
         Width           =   9135
      End
      Begin MSComctlLib.ImageCombo imcbCab 
         Height          =   345
         Index           =   1
         Left            =   5880
         TabIndex        =   4
         Top             =   360
         Width           =   3375
         _ExtentX        =   5953
         _ExtentY        =   609
         _Version        =   393216
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         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
         Locked          =   -1  'True
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         Caption         =   "Datos a Insertar:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   1
         Left            =   4440
         TabIndex        =   6
         Top             =   360
         Width           =   1455
      End
      Begin VB.Label lbl_linea 
         Alignment       =   2  'Center
         BackColor       =   &H8000000E&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   5
         Top             =   360
         Width           =   1575
      End
   End
End
Attribute VB_Name = "Form_Contrato_linea"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command4_Click()
    Dim grabarlinea As ADODB.Command
    Form_ContratoForm.grabarCabecera
    
    Set grabarlinea = New ADODB.Command
    
    grabarlinea.ActiveConnection = conn
    grabarlinea.CommandText = "REPLACE INTO cont_formato_linea set agno=" & Trim(str(Form_ContratoForm.agnoact)) & ", orden=" & Trim(str(Form_ContratoForm.ordenact)) & ",txt='" & Me.txt_linea.Text & "'"
    grabarlinea.CommandType = adCmdText
    grabarlinea.Execute
    Me.txt_linea.Text = " "
    
    Form_ContratoForm.actualizargrilla
    Form_ContratoForm.Enabled = True
    Me.txt_linea.Text = ""
    Me.Hide
    Unload Me
    
End Sub


Private Sub Command5_Click()
   Unload Me
   Form_ContratoForm.Enabled = True
   Form_ContratoForm.frm_principal.Enabled = True
End Sub

Private Sub Form_Unload(Cancel As Integer)
   Form_ContratoForm.Enabled = True
   Form_ContratoForm.frm_principal.Enabled = True
End Sub

Private Sub imcbCab_Click(Index As Integer)
 If Index = 1 Then Me.txt_linea.Text = Me.txt_linea.Text & Trim(Me.imcbCab(Index).SelectedItem.Key)

End Sub
