Test Foro de elhacker.net SMF 2.1

Programación => .NET (C#, VB.NET, ASP) => Programación General => Programación Visual Basic => Mensaje iniciado por: erick185 en 24 Marzo 2006, 05:05 AM

Título: Problemas comMsFlexGrid
Publicado por: erick185 en 24 Marzo 2006, 05:05 AM
Hola

Espero q me auxilien ya q me surgio un error en lo siguiente:

Private Sub Command2_Click()
Set BDD = OpenDatabase("d:\base2.mdb")
SQL = "SELECT * FROM tabla1 "
Set TBL = BDD.OpenRecordset(SQL)
If TBL.RecordCount > 0 Then
With MfgReporte
Do While Not TBL.EOF
.Rows = filas
filas = filas + 1
.TextMatrix(filas - 2, 0) = TBL("secuencia")
.TextMatrix(filas - 2, 1) = TBL("nombre")
.TextMatrix(filas - 2, 2) = TBL("apellido")
.TextMatrix(filas - 2, 3) = TBL("edad")

Loop
End With
End If
End Sub

al mometo de ejecutar me sale un erro q es el siguiente...


error 381

el sub indice esta fuera del intervalo....

De antemano gracias por su ayuda.

Salu2
Título: Re: Problemas comMsFlexGrid
Publicado por: V_INT_Y_2 en 7 Abril 2006, 06:01 AM
hola, mira tu proble esta en que tenes que definir las dimensiones del msflexgrid, estas definiendo en numero de filas pero no el de columnas...

seria algo asi..
    mfgreporte.Cols = 4
    mfgreporte.Rows = 1
y despues el bucle, fijate de aplicar bien la propiedad textmatrix

saludos