rangerbud249
Active member
- Joined
- Aug 18, 2004
- Messages
- 27
- Programming Experience
- Beginner
can someone let me know how to set my combobox to a specific item in my list. (q) is the id number of the row im trynig to set the combobox to.
this is the code im using.
<
Private Sub fillQuestionlist(ByVal q As Integer)
Dim rowdata As ADODB.Recordset
rowdata = fillQuestion()
rowdata.MoveFirst()
Do While Not rowdata.BOF And Not rowdata.EOF
With Me.cbquestion
.Items.Add(New Stations(rowdata.Fields(1).Value, rowdata.Fields(0).Value))
End With
rowdata.MoveNext()
Loop
End Sub
Public Function fillQuestion()
Dim rs As New ADODB.Recordset
Dim sSql As String
rs.Open("SELECT id, Question From [tbl_question.txt] order by id", dbTXTConn)
fillQuestion = rs
rs = Nothing
End Function
>
thanks,
this is the code im using.
<
Private Sub fillQuestionlist(ByVal q As Integer)
Dim rowdata As ADODB.Recordset
rowdata = fillQuestion()
rowdata.MoveFirst()
Do While Not rowdata.BOF And Not rowdata.EOF
With Me.cbquestion
.Items.Add(New Stations(rowdata.Fields(1).Value, rowdata.Fields(0).Value))
End With
rowdata.MoveNext()
Loop
End Sub
Public Function fillQuestion()
Dim rs As New ADODB.Recordset
Dim sSql As String
rs.Open("SELECT id, Question From [tbl_question.txt] order by id", dbTXTConn)
fillQuestion = rs
rs = Nothing
End Function
>
thanks,