|
-
Oct 30th, 2000, 09:01 PM
#1
Thread Starter
Lively Member
my code all works but i dont know how to display my query result in my flexigrid control
Code:
Private Sub Command1_Click()
Dim dyna As Recordset
Dim theError As Long
Dim theid As Long
theid = txtCandidateID
SQL = "Select * from candidate where candidateID = " & theid & "'"
On Local Error Resume Next
Set dyna = db.OpenRecordset(SQL, dbOpenDynaset, dbSQLPassThrough + dbSeeChanges)
theError = Err
On Local Error GoTo 0
'what do i do next to get my query result into my 'flexigrid 'control???
[/code]
-
Oct 31st, 2000, 01:46 AM
#2
Lively Member
I'm not totally sure about FlexGrid, but the example below works for the older MS Grid (I thing FlexGrid is an improved version of this).
You can use the .AddItem method to load text into cells, using the TAB character - Chr(9) - as the delimiter.
For example, from your SQL Call, lets say you returned a recordset with the fields "This", "That" "TheOther". (based on your dyna recordset).
with dyna
'Populate recordset
.movelast: .movefirst
'Loop thru and add to Grid
do while not .EOF
MSFlexGrid.AddItem ![This] & chr(9) & ![That] & chr(9) & ![TheOther]
.movenext
end with
You can use the .RemoveItem method to remove lines from the Grid.
Hope this is of assistance.
Adrian.
-
Oct 31st, 2000, 08:35 AM
#3
Frenzied Member
You can bind a FlexGrid to a data control on the form by setting it's DataSource property. However, the FlexGrid is generally crap and only displays read only records when you do finally get it to display them.
Buy Apex TrueDBGrid (www.apexsc.com)
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|