Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/05/2007, 01:03
francis_10
 
Fecha de Ingreso: mayo-2007
Mensajes: 12
Antigüedad: 17 años
Puntos: 0
Error 3021 No Hay Ningun Registro Activo

la base de datos está hecha en access,tengo definido los campos...asi que lo que quiero es insertar datos pero que dos campos(mireferencia y referenciamapfre)tienen que ser únicos.de esta forma me funciona pero no sé como controlar que si hay algun campo con un dato no se repita.

Private Sub cmdañadir_Click()
'*mensaje = MsgBox("ESTÁ SEGURO DE REALIZAR ESTA ACCIÓN", vbYesNo + vbExclamation, "ATENCIÓN!!")
'*If mensaje = 6 Then
'*sql = "INSERT INTO CLIENTES(observaciones,telefono,mireferencia) VALUES ('" & txtObservaciones.Text & "', '" & txtTelefono.Text & "','" & txtMireferencia.Text & "')"
'*If txtMireferencia = tbl("mireferencia") Or txtReferenciamapfre = tbl("referenciamapfre") Then
'*MsgBox "EL CAMPO MI REFERENCIA O REFERENCIA MAPFRE SON UTILIZADOS POR UN ÚNICO CLIENTE", vbInformation, "ATENCIÓN"
'*Else
'*bdd.Execute (sql)

'*MsgBox "OPERACIÓN REALIZADA CON ÉXITO!!", vbInformation, "enhorabuena"
LO QUE PASA QUE ASI NO CONTROLO LOS CAMPOS PARA QUE ESTOS NO SE REPITAN.
gracias.
EN RESUMEN CONTROLAR LOS CAMPOS REPETIDOS(QUE SON DOS).