Private Sub Command3_Click()
Dim Cambios1 As String
Dim Cambios2 As String
Dim Cambios3 As String
Dim Cambios4 As String

'Grabar Registro
If Btn_cancel Then
   If Len(Rsvnconfirma) = 0 Then
      MsgBox "No puede grabar esta reservacin!", vbCritical, "Numero de Confirmacin..."
      Exit Sub
   End If
    If Len(Text1) = 0 Then
        MsgBox "Es necesario introducir un nmero de cupn", vbCritical, "Numero de Cupn..."
        Text1.SetFocus
        Exit Sub
    End If
   rSearched = Rsvnconfirma.Text
   dbReservas.Recordset.Fields("Operador").Value = RsvUsuario.Text
   dbReservas.Recordset.Fields("Rsvfecha_movto").Value = Format(Now(), "dd/mm/yy")
   dbReservas.Recordset.Fields("Fecha").Value = Format(SSDateCombo1.DateValue, "DD/MM/YY")
   dbReservas.Recordset.Update
   dbReservas.Refresh
   dbReservas.Recordset.FindFirst "Nconfirmacion=" & Chr(34) & rSearched & Chr(34)
   Btn_cancel = False
End If
Reg_Saved = False
Nnew = False

Checa_pax Left(SSDateCombo1.DateValue, 10), Rsvactiv.Text, Rsvhora.Text

   Rsvlibres.Text = LibresInicial - Val(Text5) - Val(Text6)
Rsvocup.Text = DisponibilidadInicial - Val(Rsvlibres)
    Cambios1 = "Grabar "
    If ActividadInicial <> Rsvactiv.Text Then
        Cambios1 = Cambios1 & "AC:" & Rsvactiv
        If HoraInicial <> Rsvhora Then
            Cambios1 = Cambios1 & ",HR:" & Rsvhora
            If PaxAdultoInicial <> Text5 Then
                Cambios1 = Cambios1 & ",PAXA:" & Text5
                If PaxMenorInicial <> Text6 Then
                Cambios1 = Cambios1 & ",PAXM:" & Text
                End If
            Else
                If PaxMenorInicial <> Text6 Then
                Cambios1 = Cambios1 & ",PAXM:" & Text6
                End If
            End If
        Else
            If PaxAdultoInicial <> Text5 Then
                Cambios1 = Cambios1 & ",PAXA:" & Text5
                If PaxMenorInicial <> Text6 Then
                Cambios1 = Cambios1 & ",PAXM:" & Text6
                End If
            Else
                If PaxMenorInicial <> Text6 Then
                Cambios1 = Cambios1 & ",PAXM:" & Text6
                End If
            End If
        End If
    Else
        If HoraInicial <> Rsvhora Then
            Cambios1 = Cambios1 & "HR:" & Rsvhora
            If PaxAdultoInicial <> Text5 Then
                Cambios1 = Cambios1 & ",PAXA:" & Text5
                If PaxMenorInicial <> Text6 Then
                Cambios1 = Cambios1 & ",PAXM:" & Text6
                End If
            Else
                If PaxMenorInicial <> Text6 Then
                Cambios1 = Cambios1 & ",PAXM:" & Text6
                End If
            End If
        Else
            If PaxAdultoInicial <> Text5 Then
                Cambios1 = Cambios1 & "PAXA:" & Text5
                If PaxMenorInicial <> Text6 Then
                Cambios1 = Cambios1 & ",PAXM:" & Text6
                End If
            Else
                If PaxMenorInicial <> Text6 Then
                Cambios1 = Cambios1 & "PAXM:" & Text6
                End If
            End If
        End If
    End If
        
    If Cambios1 <> "Grabar " Then
    dbUlog.Recordset.AddNew
    dbUlog.Recordset.Fields("Confirmacion").Value = Rsvnconfirma.Text
    dbUlog.Recordset.Fields("Computadora").Value = FindComputerName
    dbUlog.Recordset.Fields("UsuarioWindows").Value = FindUserName
    dbUlog.Recordset.Fields("UsuarioSicres").Value = RsvUsuario.Text
    dbUlog.Recordset.Fields("Fecha").Value = Format(Now(), "dd/mm/yyyy")
    dbUlog.Recordset.Fields("Hora").Value = Format(Now(), "HH:MM:SS")
    dbUlog.Recordset.Fields("Actividad").Value = Cambios1
    dbUlog.Recordset.Update
    End If
    Cambios2 = "Grabar "
    If NombreInicial <> Rsvnombre Then
        Cambios2 = Cambios2 & "NOM:" & Rsvnombre
        If HotelInicial <> Rsvhotel Then
            Cambios2 = Cambios2 & ",HOT:" & Rsvhotel
            If HabitacionInicial <> Rsvhab Then
            Cambios2 = Cambios2 & ",HAB:" & Rsvhab
            End If
        Else
            If HabitacionInicial <> Rsvhab Then
            Cambios2 = Cambios2 & ",HAB:" & Rsvhab
            End If
        End If
    Else
        If HotelInicial <> Rsvhotel Then
            Cambios2 = Cambios2 & "HOT:" & Rsvhotel
            If HabitacionInicial <> Rsvhab Then
            Cambios2 = Cambios2 & ",HAB:" & Rsvhab
            End If
        Else
            If HabitacionInicial <> Rsvhab Then
            Cambios2 = Cambios2 & "HAB:" & Rsvhab
            End If
        End If
    End If
    If Cambios2 <> "Grabar " Then
    Sleep 1000
    dbUlog.Recordset.AddNew
    dbUlog.Recordset.Fields("Confirmacion").Value = Rsvnconfirma.Text
    dbUlog.Recordset.Fields("Computadora").Value = FindComputerName
    dbUlog.Recordset.Fields("UsuarioWindows").Value = FindUserName
    dbUlog.Recordset.Fields("UsuarioSicres").Value = RsvUsuario.Text
    dbUlog.Recordset.Fields("Fecha").Value = Format(Now(), "dd/mm/yyyy")
    dbUlog.Recordset.Fields("Hora").Value = Format(Now(), "HH:MM:SS")
    dbUlog.Recordset.Fields("Actividad").Value = Left(Cambios2, 80)
    dbUlog.Recordset.Update
    End If
    Cambios3 = "Grabar "
    If CuponInicial <> Text1 Then
        Cambios3 = Cambios3 & "CUP:" & Text1
        If NotasInicial <> Rsvnotas Then
            Cambios3 = Cambios3 & ",NOT:" & Rsvnotas
        End If
    Else
        If NotasInicial <> Rsvnotas Then
            Cambios3 = Cambios3 & "NOT:" & Rsvnotas
        End If
    End If
    If Cambios3 <> "Grabar " Then
    Sleep 1000
    dbUlog.Recordset.AddNew
    dbUlog.Recordset.Fields("Confirmacion").Value = Rsvnconfirma.Text
    dbUlog.Recordset.Fields("Computadora").Value = FindComputerName
    dbUlog.Recordset.Fields("UsuarioWindows").Value = FindUserName
    dbUlog.Recordset.Fields("UsuarioSicres").Value = RsvUsuario.Text
    dbUlog.Recordset.Fields("Fecha").Value = Format(Now(), "dd/mm/yyyy")
    dbUlog.Recordset.Fields("Hora").Value = Format(Now(), "HH:MM:SS")
    dbUlog.Recordset.Fields("Actividad").Value = Left(Cambios3, 80)
    dbUlog.Recordset.Update
    End If
    Cambios4 = "Grabar "
    If CanalInicial <> Rsvcventas Then
        Cambios4 = Cambios4 & "CA:" & Rsvcventas
        If SubCanalInicial <> Rsvsventas Then
            Cambios4 = Cambios4 & ",SU:" & Rsvsventas
            If VendedorInicial <> RsvAgente Then
                Cambios4 = Cambios4 & ",VE:" & RsvAgente
            End If
        Else
            If VendedorInicial <> RsvAgente Then
                Cambios4 = Cambios4 & ",VE:" & RsvAgente
            End If
        End If
    Else
        If SubCanalInicial <> Rsvsventas Then
            Cambios4 = Cambios4 & "SU:" & Rsvsventas
            If VendedorInicial <> RsvAgente Then
                Cambios4 = Cambios4 & ",VE:" & RsvAgente
            End If
        Else
            If VendedorInicial <> RsvAgente Then
                Cambios4 = Cambios4 & "VE:" & RsvAgente
            End If
        End If
    End If
    If Cambios4 <> "Grabar " Then
    Sleep 1000
    dbUlog.Recordset.AddNew
    dbUlog.Recordset.Fields("Confirmacion").Value = Rsvnconfirma.Text
    dbUlog.Recordset.Fields("Computadora").Value = FindComputerName
    dbUlog.Recordset.Fields("UsuarioWindows").Value = FindUserName
    dbUlog.Recordset.Fields("UsuarioSicres").Value = RsvUsuario.Text
    dbUlog.Recordset.Fields("Fecha").Value = Format(Now(), "dd/mm/yyyy")
    dbUlog.Recordset.Fields("Hora").Value = Format(Now(), "HH:MM:SS")
    dbUlog.Recordset.Fields("Actividad").Value = Left(Cambios4, 80)
    dbUlog.Recordset.Update
    End If
    dbUlog.Refresh
    
    Check2.Value = False
   '
   'Habilitar Comandos
   '
    Command1.Enabled = True
    DispW.Enabled = True
    cmdConsulta.Enabled = True
    Hotel.Enabled = True
    Command4.Enabled = True
    cmdVendedores.Enabled = True
    cmdRreservas.Enabled = True
    Command15.Enabled = True
    cmdSalir.Enabled = True
    cmdModificar.Enabled = True
    Command12.Enabled = True
    Allotment.Enabled = True
    SSDBData1.Enabled = True
    Command1.Enabled = True
    Command2.Enabled = True
    '
    'Deshabilitar Controles
    '
    SSDateCombo1.Enabled = False
    Rsvactiv.Enabled = False
    Rsvhora.Enabled = False
    Text5.Enabled = False
    Text6.Enabled = False
    Text7.Enabled = False
    Rsvnombre.Enabled = False
    Rsvhotel.Enabled = False
    Rsvtelefono.Enabled = False
    Rsvhab.Enabled = False
    Text1.Enabled = False
    Rsvnotas.Enabled = False
    Rsvcventas.Enabled = False
    Rsvsventas.Enabled = False
    RsvAgente.Enabled = False
    Check1.Value = False
    Check1.Enabled = False
    Command2.Enabled = False
    Command3.Enabled = False
    Command4.Enabled = False
    Allotment.Enabled = False
    DispW.Enabled = False
End Sub
