He puesto este codigo:
Código vb:
Ver originalPrivate Sub Command5_Click()
Dim ID As Integer
Set cnPrueba = New Connection
'Establecer sus propiedades
With cnPrueba
.Provider = "Microsoft.Jet.oledb.4.0"
.ConnectionString = "prueba.mdb"
End With
cnPrueba.Open
Set rsTbl_Direccion = New Recordset
'Establecer sus propiedades
With rsTbl_Direccion
.CursorLocation = adUseClient
cnPrueba.Execute "UPDATE tbl_direccion SET nombre='" & Text1 & "', apellidos='" & Text4 & "',direccion='" & Text5 & "',ciudad='" & Combo1 & "',provincia='" & Combo2 & "',telefono='" & Text2 & "',cp='" & Text6 & "' Where id = " & ID & ""
.ActiveConnection = cnPrueba
.LockType = adLockOptimistic
End With
With rsTbl_Direccion
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1) = Form1.Text1.Text
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2) = Form1.Text4.Text
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 3) = Form1.Text5.Text
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 4) = Form1.Combo1.Text
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 5) = Form1.Combo2.Text
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 6) = Form1.Text2.Text
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 7) = Form1.Text6.Text
End With
End Sub
No da errores pero no me guarda a fila que edito