Como Pasar Datos de un MSFlexgrid a un DataReport
Publicado por yordin (6 intervenciones) el 13/06/2019 23:04:39
Buenas tardes.
estoy creando un programa en el cual lleno un MSFlexgrid desde una base de datos en Acces, esto lo hace todo excelente, pero necesito que al dar doble click en el flex esta linea se pase a un DataReport a unos RptTexbox y no encuentro la manera.
de momento tengo un form creado donde al dar doble click es llenado cada campo bien con los datos del flex utilizo el siguiente código:
necesito me puedan explicar como llenar el Datareport de igual manera que lleno el Form llamado frmEdit, las cajas de texto del Datareport tienen los nombres idénticos a los campos del grid y del form ejemplo: CIA, FICHA, CEDULA, NOMBRES, ABONOS,DIRECCION EXTC...
espero me puedan colaborar..
estoy creando un programa en el cual lleno un MSFlexgrid desde una base de datos en Acces, esto lo hace todo excelente, pero necesito que al dar doble click en el flex esta linea se pase a un DataReport a unos RptTexbox y no encuentro la manera.
de momento tengo un form creado donde al dar doble click es llenado cada campo bien con los datos del flex utilizo el siguiente código:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Private Sub Editar()
Dim t5 As Currency, t6 As Currency, t7 As Currency, t8 As Currency
On Error Resume Next
frmEdit.CIA.Caption = Grid1.TextMatrix(Grid1.RowSel, 13)
frmEdit.FICHA.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 1), "##,##0")
frmEdit.CEDULA.Caption = Grid1.TextMatrix(Grid1.RowSel, 2) & "-" & Format(Grid1.TextMatrix(Grid1.RowSel, 3), "##,##0")
frmEdit.NOMBRES.Caption = Grid1.TextMatrix(Grid1.RowSel, 4)
frmEdit.INGRESO.Caption = Grid1.TextMatrix(Grid1.RowSel, 5)
frmEdit.EGRESO.Caption = Grid1.TextMatrix(Grid1.RowSel, 6)
frmEdit.MOTIVO.Caption = Grid1.TextMatrix(Grid1.RowSel, 23)
frmEdit.ANTIGÜEDAD.Caption = Grid1.TextMatrix(Grid1.RowSel, 24)
frmEdit.GERENCIA.Caption = Grid1.TextMatrix(Grid1.RowSel, 7)
frmEdit.DPTO.Caption = Grid1.TextMatrix(Grid1.RowSel, 8)
frmEdit.CARGO.Caption = Grid1.TextMatrix(Grid1.RowSel, 9)
frmEdit.CUENTA.Caption = Grid1.TextMatrix(Grid1.RowSel, 26)
frmEdit.SUELDO.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 10), "##,##0.00")
frmEdit.ESCALA.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 11), "##,##0.00")
frmEdit.BONO.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 12), "##,##0.00")
frmEdit.ABONOS.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 18), "##,##0.00")
frmEdit.ANTICIPOS.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 19), "##,##0.00")
frmEdit.FARMACIA.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 21), "##,##0.00")
frmEdit.MEDICINA.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 20), "##,##0.00")
frmEdit.DIRECCION.Caption = Format(Grid1.TextMatrix(Grid1.RowSel, 22), "##,##0.00")
On Error Resume Next
If IsNumeric(SUELDO) Then t5 = CDec(SUELDO)
If IsNumeric(ESCALA) Then t6 = CDec(ESCALA)
If IsNumeric(BONO) Then t7 = CDec(BONO)
If IsNumeric(PROMEDIO) Then t8 = CDec(PROMEDIO)
PROMEDIO = (t5 + t6 + t7)
frmEdit.Show
DATA.Hide
End Sub
necesito me puedan explicar como llenar el Datareport de igual manera que lleno el Form llamado frmEdit, las cajas de texto del Datareport tienen los nombres idénticos a los campos del grid y del form ejemplo: CIA, FICHA, CEDULA, NOMBRES, ABONOS,DIRECCION EXTC...
espero me puedan colaborar..
Valora esta pregunta


0