Code:
Private Sub Command1_Click()

Dim dyna As Recordset
Dim TheError As Long
Dim theid As Long

 theid = txtCandidateID
SQL= "select historydate,historyconsultant,historyaction,historyquicknotes 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

MSFlexGrid1.Clear
Select Case TheError
Case 3146
'case 3146 means there are no records in the database 

Case 0


    MSFlexGrid1.AddItem dyna("historydate")
    MSFlexGrid1.AddItem dyna("historyconsultant")
    MSFlexGrid1.AddItem dyna("historyaction")
    MSFlexGrid1.AddItem dyna("historyquicknotes")
    
End Select
dyna.Close
Set dyna = Nothing
End Sub
i want to open my database and display my result in my flexigrid control????

help me please
my database opens up perfectly but i dont know how to get my data from my database and put it in my msflexgridcontrol
i do not want to use any datacontrols i want to do this programmically...because my SQl statement does not work with
datacontrols due to the fact that it does not picksup my variable theid as a value i come up with errors!!!!
im also using an SQL 7 Database???
anyone any ideas???