VERSION 5.00
Begin VB.Form frmNroCaja 
   BackColor       =   &H00404080&
   Caption         =   "Cambiar Nro Caja"
   ClientHeight    =   2370
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4470
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   2370
   ScaleWidth      =   4470
   StartUpPosition =   1  'CenterOwner
   Begin VB.TextBox txtnuevo 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2160
      TabIndex        =   1
      Top             =   1320
      Width           =   1215
   End
   Begin VB.TextBox txtactual 
      Alignment       =   1  'Right Justify
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2160
      TabIndex        =   0
      Top             =   840
      Width           =   1215
   End
   Begin VB.CommandButton CmdGrabar 
      Caption         =   "&Cambiar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1560
      TabIndex        =   2
      Top             =   1785
      Width           =   1335
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   0
      Picture         =   "FrmNroCaja.frx":0000
      Top             =   0
      Width           =   480
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "Ya existen Operaciones  registradas con el Número de Caja"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   720
      TabIndex        =   5
      Top             =   120
      Width           =   3375
      WordWrap        =   -1  'True
   End
   Begin VB.Label Label2 
      BackColor       =   &H00404080&
      Caption         =   "Nueva Caja"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000E&
      Height          =   255
      Left            =   480
      TabIndex        =   4
      Top             =   1320
      Width           =   1695
   End
   Begin VB.Label Label1 
      BackColor       =   &H00404080&
      Caption         =   "Caja Actual"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000E&
      Height          =   255
      Left            =   480
      TabIndex        =   3
      Top             =   900
      Width           =   1335
   End
   Begin VB.Shape Shape1 
      BackStyle       =   1  'Opaque
      BorderStyle     =   0  'Transparent
      Height          =   735
      Left            =   0
      Top             =   0
      Width           =   4575
   End
End
Attribute VB_Name = "frmNroCaja"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sOperacion As String
Dim procedencia As Integer

Public Sub Inicio(Caja As String, sOper As String, proced As Integer)
Me.txtactual.Text = Caja
sOperacion = sOper
procedencia = proced
End Sub

Private Sub cmdGrabar_Click()
Dim sSql As String
Dim ADORS2 As ADODB.Recordset

sCajacodiNew = "Caja" & Right(("00" & Trim(Me.txtnuevo.Text)), 2)
If procedencia = 1 Then
sSql = "Select count(*) as nroreg from Operacion Where  cOperId= " & sOperacion & " and  cCajacodi= '" & sCajacodiNew & "'"
Else
sSql = "Select count(*) as nroreg from OperacionParalela Where  cOperCode= " & sOperacion & " and  cCajacodi= '" & sCajacodiNew & "'"
End If
If Not oDBAdmin.EjecutarConsulta(ADOCnnSQL, sSql, ADORS2) Then GoTo Salir
If (ADORS2!nroreg) > 0 Then
    MsgBox "Ya existen operaciones registradas con este número de Caja"
    Me.txtnuevo.SetFocus
    Set ADORS2 = Nothing
Else
    kPAR_CAJA = sCajacodiNew
    EscribirCfg "PARAMETROS", "Caja", psArchivoCfg, kPAR_CAJA
    Unload Me
End If
Salir:
End Sub

