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.

Ayuda para completar macro para validar si datos ya existen en la base de datos de Access

publicado

Hola grupo recurro a ustedes para la ayuda para completar un Macro

Tengo este macro que me valida desde Excel si un dato ya existe en la base de datos de ACCESS.

   Set Rs = New ADODB.Recordset
   Sql = "SELECT Count(*) FROM a_revisiones WHERE [cedula]='" & .Range("J2") & "'"
   Rs.Open Sql, Cnn, 3, 3, adCmdText
   Datos = Rs.GetRows
   If Datos(0, 0) > 0 Then
      MsgBox "El registro ya existe en la base de datos!!!", vbCritical, "Sistema"
   Else

Nombre de base de datos en Access "a_revisiones", campos "cedula, nombre y estado"

Me funciona bien cuando solo solo requiero ingresar un registro igual en cedula, cuando debo registrar más datos me sale el mensaje "El registro ya existe en la base de datos!!!". Pero requiero que me permita ingresar nuevos registros cuando el estado de la cedula esta en "archivo".

Espero de la ayuda de usted, saludos

 

Featured Replies

publicado
   Set Rs = New ADODB.Recordset
   Sql = "SELECT Count(*) FROM a_revisiones WHERE [cedula]='" & .Range("J2") & "'"
   Sql = Sql & " AND [estado]<>'archivo'"
   Rs.Open Sql, Cnn, 3, 3, adCmdText
   Datos = Rs.GetRows
   If Datos(0, 0) > 0 Then
      MsgBox "El registro ya existe en la base de datos!!!", vbCritical, "Sistema"
   Else

 

publicado
  • Autor

Funciono muy bien muchas gracias 

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.