by romi (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 22nd July 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Populate Msflexgrid through Recordset
API Declarations
' in mycase name of msflexgrid is dbplayer
Public Sub populateDB(rss As Recordset)
Dim x As Integer
Dim dbrows As Integer
dbplayer.Cols = rss.Fields.Count
dbplayer.Rows = rss.RecordCount + 1
dbplayer.Row = 0
Do Until x = dbplayer.Cols
dbplayer.Col = x
dbplayer.Text = UCase(rss.Fields(x).Name)
dbplayer.BackColorSel = &H8000000B
x = x + 1
Loop
x = 0
dbrows = 1
Do Until dbrows = rss.RecordCount + 1
Do Until x = dbplayer.Cols
dbplayer.Col = x
dbplayer.Row = dbrows
dbplayer.Text = UCase(rss.Fields(x))
dbplayer.BackColorSel = &H8000000B
x = x + 1
Loop
x = 0
dbrows = dbrows + 1
rss.MoveNext
Loop
End Sub