Hi guys,
Im having problems with my project. I can not seem to fill data from a database into a combo box. I have the code :
Private Sub FillcboConditio n()
Dim pstConditionSQL As String
Dim prsCondition As New ADODB.Recordset
pstConditionSQL = "Select ConditionCode, ConditionDesc " & _
"from tblCondition "
prsCondition.Op en pstConditionSQL , gcnLibrary, adOpenStatic & _
adLockOptimisti c, adCmdText
cboCondition.Cl ear
Do While Not prsCondition.EO F
cboCondition.Ad dItem prsCondition!Co nditionCode & " - " & _
prsCondition!Co nditionDesc
prsCondition.Mo veNext
Loop
cboCondition.Te xt = "Select..."
End Sub
But it just does not work. Also with my flexgrid it seems to put the data under different heading??
I dont understand the error that pops up either. SO just confused!
Thanks
Im having problems with my project. I can not seem to fill data from a database into a combo box. I have the code :
Private Sub FillcboConditio n()
Dim pstConditionSQL As String
Dim prsCondition As New ADODB.Recordset
pstConditionSQL = "Select ConditionCode, ConditionDesc " & _
"from tblCondition "
prsCondition.Op en pstConditionSQL , gcnLibrary, adOpenStatic & _
adLockOptimisti c, adCmdText
cboCondition.Cl ear
Do While Not prsCondition.EO F
cboCondition.Ad dItem prsCondition!Co nditionCode & " - " & _
prsCondition!Co nditionDesc
prsCondition.Mo veNext
Loop
cboCondition.Te xt = "Select..."
End Sub
But it just does not work. Also with my flexgrid it seems to put the data under different heading??
I dont understand the error that pops up either. SO just confused!
Thanks
Comment