Ver Mensaje Individual
  #10 (permalink)  
Antiguo 22/04/2010, 14:47
Avatar de Sergio18
Sergio18
 
Fecha de Ingreso: abril-2010
Ubicación: No quieras saberlo
Mensajes: 94
Antigüedad: 15 años
Puntos: 0
Respuesta: Editar msflexgrid con un formulario

He puesto este codigo:

Código vb:
Ver original
  1. Private Sub Command5_Click()
  2. Dim ID As Integer
  3. Set cnPrueba = New Connection
  4. 'Establecer sus propiedades
  5.     With cnPrueba
  6.         .Provider = "Microsoft.Jet.oledb.4.0"
  7.         .ConnectionString = "prueba.mdb"
  8.      End With
  9.     cnPrueba.Open
  10. Set rsTbl_Direccion = New Recordset
  11. 'Establecer sus propiedades
  12. With rsTbl_Direccion
  13.     .CursorLocation = adUseClient
  14.     cnPrueba.Execute "UPDATE tbl_direccion SET nombre='" & Text1 & "', apellidos='" & Text4 & "',direccion='" & Text5 & "',ciudad='" & Combo1 & "',provincia='" & Combo2 & "',telefono='" & Text2 & "',cp='" & Text6 & "' Where id = " & ID & ""
  15.     .ActiveConnection = cnPrueba
  16.     .LockType = adLockOptimistic
  17. End With
  18. With rsTbl_Direccion
  19.     MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1) = Form1.Text1.Text
  20.     MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2) = Form1.Text4.Text
  21.     MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 3) = Form1.Text5.Text
  22.     MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 4) = Form1.Combo1.Text
  23.     MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 5) = Form1.Combo2.Text
  24.     MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 6) = Form1.Text2.Text
  25.     MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 7) = Form1.Text6.Text
  26. End With
  27. End Sub

No da errores pero no me guarda a fila que edito