For some reason that I do not know of, The flexgrid is not showing the first fields inside my database. what is wrong?
why will it not show the first field inside my database?
how do I fix this error?
Code:Private Sub LoadRec() 'THIS WILL LOAD DATABASE TO REFLEX GRID Dim Y As String Dim Rowcount As Integer Rowcount = 2 Set DB = OpenDatabase(App.Path & "\Database\Products.mdb") Y = "select * from Inventory where number <> ''" Set Rec = DB.OpenRecordset(Y, dbOpenSnapshot) If Rec.EOF = False Then Rec.MoveNext Do While Not Rec.EOF 'THIS WILL READ THE ROWCOUNT 1 BY 1 UNTIL IT REACHES 6 THEN ENDS If Rowcount >= 6 Then Grid.Rows = Grid.Rows + 1 End If 'THIS WILL READ THE DATABASE FIELDS Grid.TextMatrix(Rowcount, 0) = Rec!Number Grid.TextMatrix(Rowcount, 1) = Rec!Name Grid.TextMatrix(Rowcount, 2) = Rec!Price Grid.TextMatrix(Rowcount, 3) = Rec!Quantity Grid.TextMatrix(Rowcount, 4) = Rec!Vendor Grid.TextMatrix(Rowcount, 5) = Rec!Description Rowcount = Rowcount + 1 Rec.MoveNext Loop DB.Close End If End Sub




Reply With Quote
