este es un ejemplo espero que te sirva
Código:
Dim A As Integer
Dim db As Connection
Dim adoPrimaryRS As Recordset
Set db = New Connection
Set adoPrimaryRS = New Recordset
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & BasePath
adoPrimaryRS.Open "select * from consulta_detalle_cargos where id_registro=" & FacRegistro & "", db, adOpenStatic, adLockOptimistic
If adoPrimaryRS.BOF = False Then
Me.ListadoDetalleFactura.Rows = adoPrimaryRS.RecordCount + 1
adoPrimaryRS.MoveFirst
For A = 1 To adoPrimaryRS.RecordCount
Me.ListadoDetalleFactura.TextMatrix(A, 1) = adoPrimaryRS!id_servicio
Me.ListadoDetalleFactura.TextMatrix(A, 2) = adoPrimaryRS!nombre
Me.ListadoDetalleFactura.TextMatrix(A, 3) = adoPrimaryRS!cantidad
Me.ListadoDetalleFactura.TextMatrix(A, 4) = adoPrimaryRS!Total
adoPrimaryRS.MoveNext
Next A
End If
listadodetallefactura es el MsFlexgrid