Visual Basic para Aplicaciones - flexgrid

Life is soft - evento anual de software empresarial
 
Vista:

flexgrid

Publicado por JOSE JUAN (8 intervenciones) el 12/07/2002 17:32:43
Hola !

En un control de MSFLEXGRID, como se agregan datos.

Al hacer click sobre una fila y columna, como capturar un 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:flexgrid

Publicado por Nelson Fredericksen (10 intervenciones) el 12/07/2002 19:40:45
Tratamiento completo de MsFlexGrid, con edición de celdas, espero que sealo que buscas (fg2 = MSFlexGrid)

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!idisap = registro
GenIsap!noisap = fg2.TextMatrix(linea, 2)
If fg2.T
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