Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

se llena la base de datos fila x medio

publicado

Hola etimados miembros del foro , tengo el siguiente problema , parece **maravilloso** pero no logro darme cuenta del error, cuando quiero registra un nuevo cliente a traves del fomulario este lo hace pero fila por medio , no lo hace como deberia uno debajo del ultimo el cod es :

 

Option Explicit
Dim CelEncontrada As Range
Dim CodigoAux As Variant


Private Sub Bot_Limpiar_Click()
Call ModClientes.LimpiarFormulario
End Sub

 
Private Sub Bot_Registrar_Click()

With frmClientes

If .TxtIdCliente.Value = "" Then
    MsgBox "Digite el n° de documento del cliente"
    .TxtIdCliente.SetFocus
    Exit Sub
End If
    
If .TxtNombre.Value = "" Then
    MsgBox "Digite el Nombre del cliente"
    .TxtApellido.SetFocus
    Exit Sub
End If
If .TxtApellido.Value = "" Then
    MsgBox "Digite el Apellido del cliente"
    .TxtApellido.SetFocus
    Exit Sub
End If

If .TxtCel1.Value = "" Then
    MsgBox "Digite el n° celular del cliente"
    .TxtCel1.SetFocus
    Exit Sub
End If

If .TxtDireccion.Value = "" Then
    MsgBox "Digite la direccion del cliente"
    .TxtDireccion.SetFocus
    Exit Sub
End If

If .TxtLocalidad.Value = "" Then
    MsgBox "Digite la localidad o ciudad del cliente"
    .TxtLocalidad.SetFocus
    Exit Sub
End If

If .TxtProvincia.Value = "" Then
    MsgBox "Digite la provincia del cliente"
    .TxtProvincia.SetFocus
    Exit Sub
End If

If .TxtPuntoContac.Value = "" Then
    MsgBox "Digite un punto de contacto"
    .TxtPuntoContac.SetFocus
    Exit Sub
End If

If .TxtRelacion.Value = "" Then
    MsgBox "Digite que relacion tiene con el cliente"
    .TxtRelacion.SetFocus
    Exit Sub
End If

If .TxtCel2.Value = "" Then
    MsgBox "Digite el n° de celular del punto de contacto"
    .TxtCel2.SetFocus
    Exit Sub
End If
End With
  
    Dim Codigo As Variant
    Dim ColCodigo As Range
  
    Codigo = frmClientes.TxtIdCliente.Value
    Set ColCodigo = Hoja3.ListObjects("Tab_Clientes").ListColumns(1).Range

    Set CelEncontrada = ColCodigo.Find(what:=Codigo, After:=ColCodigo.Cells(1), LookAt:=xlPart)

  If Not CelEncontrada Is Nothing Then
  If MsgBox(" EL documento ya existe,¿quiere crearlo nuevamente?", vbYesNo) = vbNo Then
  frmClientes.TxtIdCliente.SetFocus
           
           Exit Sub
           End If
  End If
    Set CelEncontrada = Hoja3.ListObjects("Tab_Clientes").ListRows.Add.Range.Cells(1)

 Set CelEncontrada = Hoja3.ListObjects("Tab_Clientes").ListRows.Add.Range.Cells(1)
 
 With frmClientes
  CelEncontrada.Offset(0, 0).Value = .TxtIdCliente
  CelEncontrada.Offset(0, 1).Value = .TxtNombre
  CelEncontrada.Offset(0, 2).Value = .TxtApellido
  CelEncontrada.Offset(0, 3).Value = .TxtCel1
  CelEncontrada.Offset(0, 4).Value = .TxtTelFijo1
  CelEncontrada.Offset(0, 5).Value = .TxtDireccion
  CelEncontrada.Offset(0, 6).Value = .TxtLocalidad
  CelEncontrada.Offset(0, 7).Value = .TxtProvincia
  CelEncontrada.Offset(0, 8).Value = .TxtPuntoContac
  CelEncontrada.Offset(0, 9).Value = .TxtRelacion
  CelEncontrada.Offset(0, 10).Value = .TxtCel2
  CelEncontrada.Offset(0, 11).Value = .TxtTelFijo2
  
  End With
   Set CelEncontrada = Nothing
   
   Call ModClientes.LimpiarFormulario
   MsgBox "CLIENTE REGISTRADO"
   

   End Sub
   

Featured Replies

publicado

buenas, mirando por encima creo que el error es que tienes duplicada una la linea .
    

Set CelEncontrada = Hoja3.ListObjects("Tab_Clientes").ListRows.Add.Range.Cells(1)

saludos

publicado
Hace 7 horas, JasallBcn dijo:

buenas, mirando por encima creo que el error es que tienes duplicada una la linea .
    

Set CelEncontrada = Hoja3.ListObjects("Tab_Clientes").ListRows.Add.Range.Cells(1)

saludos

¡Si señor! ?

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.