no borra los datos de la base de datos
Publicado por David (16 intervenciones) el 12/07/2017 20:22:32
Hola alguien me puede ayudar estoy haciendo una factura y quiero saber porque no borra los datos de la base de datos. el codigo que tengo enel boton eliminar es el siguiente:
ME SALE EL MENSAJE QUE SE BORRO PERO NO BORRA. COMO QUE AL .DELETE NO ESTA FUNCIONANDO.
EN EL DATAGRID TENGO ESTO
ME SALE EL MENSAJE QUE SE BORRO PERO NO BORRA. COMO QUE AL .DELETE NO ESTA FUNCIONANDO.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Private Sub cmdBorrar_Click()
If lblCodigo.Caption = "" Then
MsgBox "Elija un objeto de la lista", vbInformation, "AVISO"
Exit Sub
Else
With RsFactura
.Requery
.Find "id='" & Trim(lblCodigo.Caption) & "'"
'Si no encontró el registro
If .EOF Then
MsgBox "No se encontró el registro", vbInformation, "No se encontro"
Exit Sub
Else
If MsgBox("¿Desea eliminar el contacto: " & DataGrid1.Columns(2) & "?", vbInformation + vbYesNo) = vbYes Then
.Delete
.Requery
'Esto evita si quiero eliminar un registro y lo vuelvo eliminar no me permitira a hacerlo
lblCodigo.Caption = 0
End If
End If
End With
End If
FormatoGrillaTemporal
End Sub
EN EL DATAGRID TENGO ESTO
1
2
3
4
5
6
7
8
9
10
Private Sub DataGrid1_Click()
If DataGrid1.ApproxCount < 1 Then
MsgBox "No ha seleccionado ninguno objeto de la lista!!", vbExclamation, "AVISO"
Else
lblCodigo.Caption = DataGrid1.Columns(0).Text
End If
End Sub
Valora esta pregunta


0