Cuando agrego un registro, me lo pasa al flexgrid, ordenado y bien. Cuando lo selecciono de la grilla y lo paso a los txt y combos para darle a "modificar" que lo unico que hace es poner su propiedad locked en false, modifico sobre estos controles, pero al darle aceptar nuevamente solo me muestra en la grilla el registro modificado...si salgo e ingreso nuevamente ahora si, estan todos los datos alli...
Cuando borro un registro me saca de la grilla TODOS los datos. Si salgo y entro, estan de nuevo, salvo el que borre, claro. Ahora si cuando le doy al boton borrar y despues en el msgbox le doy a cancelar...se desordenan los registros en el flexgrid....
Bueno, el codigo lo tengo de la siguiente manera:
Código:
Private Sub CmdBorrar_Click()
'BOTON BORRAR
If fila <> 0 Then
A = MsgBox("Borrar el dato?", "49", "Sistema")
If A = 1 Then
rs1.Delete
MSFlexGrid1.Clear
MSFlexGrid1.TextMatrix(0, 0) = "Tipo"
MSFlexGrid1.TextMatrix(0, 1) = "Tema1"
MSFlexGrid1.TextMatrix(0, 2) = "Tema2"
MSFlexGrid1.TextMatrix(0, 3) = "Tema3 "
MSFlexGrid1.TextMatrix(0, 4) = " Tema4 "
MSFlexGrid1.TextMatrix(0, 5) = "Tema5"
MSFlexGrid1.TextMatrix(0, 6) = "Tema6"
End If
f = 0
If rs1.EOF = False Then rs1.MoveFirst
While rs1.EOF = False
f = f + 1
MSFlexGrid1.TextMatrix(f, 0) = rs1("Tipo")
MSFlexGrid1.TextMatrix(f, 1) = rs1("Tema1")
MSFlexGrid1.TextMatrix(f, 2) = rs1("Tema2")
MSFlexGrid1.TextMatrix(f, 3) = rs1("Tema3")
MSFlexGrid1.TextMatrix(f, 4) = rs1("Tema4")
MSFlexGrid1.TextMatrix(f, 5) = rs1("Tema5")
MSFlexGrid1.TextMatrix(f, 6) = rs1("Tema6")
rs1.MoveNext
Wend
End If
' BLANQUEO DE CONTROLES
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Combo1 = ""
Combo2 = ""
Combo3 = ""
End Sub
'-------------------------------------------------------------------'
Código:
Private Sub CmdAceptar_Click()
'* BOTON ACEPTAR *'
If señal = 1 Then
If rs1.EOF = False Then
MsgBox "Error", vbCritical, "Campos en blanco, nulo o repetido"
GoTo 100
Else
rs1.AddNew
End If
End If
rs1("Tipo") = Combo1
rs1("Tema1") = Text1
rs1("Tema2") = Combo2
rs1("Tema3") = Combo3
rs1("Tema4") = Text2
rs1("Tema5") = Text3
rs1("Tema6") = Text4
rs1.Update
Rem blanqueo de grilla
MSFlexGrid1.Clear
MSFlexGrid1.TextMatrix(0, 0) = "Tipo"
MSFlexGrid1.TextMatrix(0, 1) = "Tema1"
MSFlexGrid1.TextMatrix(0, 2) = "Tema2"
MSFlexGrid1.TextMatrix(0, 3) = " Tema3"
MSFlexGrid1.TextMatrix(0, 4) = "Tema4"
MSFlexGrid1.TextMatrix(0, 5) = "Tema5 "
MSFlexGrid1.TextMatrix(0, 6) = "Tema6"
f = 0
If rs1.EOF = False Then rs1.MoveFirst
While rs1.EOF = False
f = f + 1
MSFlexGrid1.TextMatrix(f, 0) = rs1("Tipo")
MSFlexGrid1.TextMatrix(f, 1) = rs1("Tema1")
MSFlexGrid1.TextMatrix(f, 2) = rs1("Tema2")
MSFlexGrid1.TextMatrix(f, 3) = rs1("Tema3")
MSFlexGrid1.TextMatrix(f, 4) = rs1("Tema4")
MSFlexGrid1.TextMatrix(f, 5) = rs1("Tema5")
MSFlexGrid1.TextMatrix(f, 6) = rs1("Tema6")
rs1.MoveNext
Wend
100
Rem blanquear todos los controles y botones
Combo1 = ""
Combo2 = ""
Combo3 = ""
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
End Sub
Bueno desde ya muchas gracias si alguno me tira una idea y saludos gente!