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

Public Sub Inicio(Caja As String)
txtactual.Text = Caja
End Sub

Private Sub cmdGrabar_Click()
Dim ssql As String
Dim ADORS2 As ADODB.Recordset
If Trim(Me.txtnuevo.Text) = "" Then
   MsgBox "Debe ingresar un Código de Caja", vbCritical, "Error"
Else
    sCajacodiNew = "Caja" & Right(("00" & Trim(Me.txtnuevo.Text)), 2)
    kPAR_CAJA = sCajacodiNew
    EscribirCfg "PARAMETROS", "Caja", psArchivoCfg, kPAR_CAJA
    '----Dejar un log ----------------------'
    Dim NameArchivo As String
    Dim archivo
    Dim Texto As String
    Dim fso, MyFile
    Set fso = CreateObject("Scripting.FileSystemObject")
    archivo = "CambioCaja" + Format(Date, "ddmmyyyy")
    If Trim(archivo) = "" Then
        archivo = "textfile"
    End If
    Texto = Texto + "Cambio de numeracion de caja de " & Me.txtactual.Text & " a " + txtnuevo.Text + Chr(13)
    
    NameArchivo = "C:\Temp\" + Trim(archivo) + ".log"
    Set MyFile = fso.CreateTextFile(NameArchivo, True)
    Texto = Texto + CStr(Now)
    MyFile.WriteLine (Texto)
    MyFile.Close
    
    Unload Me
End If
End Sub

