Visual Basic - capturar datos en FlexGrid

Life is soft - evento anual de software empresarial
 
Vista:

capturar datos en FlexGrid

Publicado por JOSE JUAN (22 intervenciones) el 12/07/2002 17:37:37
Un hola a todos de esta comunidad:

Como capturo datos en un MSFLEXGRID. al hacer un click en una columna y fila de este control, que comandos uso para, capturar datos.

Gracias por la ayuda
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:capturar datos en FlexGrid

Publicado por Nelson Fredericksen (125 intervenciones) el 12/07/2002 19:57:35
Primero colocas el MSFlexGrid en el formulario,luego le agregas sobre el MSFlexGrid un Control TextBox, y aquí va el código para trabajar; si salen incompleto, te envío por mail Ejemplo con form Incluído

Dim contador As Integer

Sub msflexgridedit(MSFlexGrid As Control, edt As Control, keyascii As Integer)
Select Case keyascii
Case 0 To 32
edt = MSFlexGrid
edt.SelStart = 1000
Case Else
edt = Chr(keyascii)
edt.SelStart = 1
End Select
edt.Move MSFlexGrid.CellLeft, MSFlexGrid.CellTop, _
MSFlexGrid.CellWidth, MSFlexGrid.CellHeight
edt.Visible = True
edt.SetFocus
End Sub

Private Sub command1_Click()
'borra un determinado registro
Dim d As Integer
Set GenIsap = base.OpenRecordset("select * from Genisapre")
d = Val(fg2.TextMatrix(fg2.Row, 1))
strbusca = "idisap =" & d
GenIsap.FindFirst strbusca
GenIsap.Delete
GenIsap.Close
Call Form_Load
End Sub

Private Sub fg2_DblClick()
msflexgridedit fg2, txtedit, 32
End Sub

Private Sub fg2_KeyPress(keyascii As Integer)
msflexgridedit fg2, txtedit, keyascii
End Sub

Private Sub Guardar_Click()
Dim registro As Integer
Dim linea As Integer
On Error Resume Next
Set GenIsap = base.OpenRecordset("select * from GenIsapre")
For linea = 1 To fg2.Rows - 1
registro = Val(fg2.TextMatrix(linea, 1))
strbusca = "idisap =" & registro
GenIsap.FindFirst strbusca
If GenIsap.NoMatch Then
GenIsap.AddNew
GenIsap!idis
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar