i have this code to populate combobox... but my problem is.. i need to get those 2 values i put in the combobox... one it is selected...
Private Sub Fill_CBBookChapterVerse(ByVal ComboBox As ComboBox)
ComboBox.Items.Clear()
Dim dbFile As String
dbFile = strBibleDataPath & strBibleFilename
Dim cnndbFile As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & _
dbFile & ";Mode=Read;Jet OLEDBatabase Password=" & strBiblePw(strBibleID))
cnndbFile.Open()
' Read "BibleList" Table
Dim BListSelectQuery As String = "SELECT a.BookNum, a.Chapter, a.Verse, b.BookStdName From BibleVerses a, BibleBooks b WHERE a.BookNum = b.BookNum"
Dim BListCommand As New OleDb.OleDbCommand(BListSelectQuery, cnndbFile)
Dim BListReader As OleDb.OleDbDataReader
BListReader = BListCommand.ExecuteReader()
Dim nCount As Integer
If BListReader.HasRows Then
ComboBox.Items.Add("Select Verse")
ComboBox.SelectedIndex = 0
Do While (BListReader.Read())
Dim Book, Chapter, Verse, ChapterVerse As String
Book = BListReader.GetValue(BListReader.GetOrdinal("BookStdName")).ToString
Chapter = BListReader.GetValue(BListReader.GetOrdinal("Chapter")).ToString
Verse = BListReader.GetValue(BListReader.GetOrdinal("Verse")).ToString
ChapterVerse = Book & " " & Chapter & ":" & Verse
ComboBox.Items.Add(ChapterVerse)
Loop
nBibleMax = nCount
BListReader.Close()
Else
'MsgBox("Error on BibleList")
'ProjDataErrorMsg &= "No bibles listed." & vbCrLf
End If
BListReader.Dispose()
cnndbFile.Close()
End Sub ' Fill Combo Box Book, Chapter, Verse
i need to get the chapter and verse... i dont know if there is any way... help...
Private Sub Fill_CBBookChapterVerse(ByVal ComboBox As ComboBox)
ComboBox.Items.Clear()
Dim dbFile As String
dbFile = strBibleDataPath & strBibleFilename
Dim cnndbFile As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & _
dbFile & ";Mode=Read;Jet OLEDBatabase Password=" & strBiblePw(strBibleID))
cnndbFile.Open()
' Read "BibleList" Table
Dim BListSelectQuery As String = "SELECT a.BookNum, a.Chapter, a.Verse, b.BookStdName From BibleVerses a, BibleBooks b WHERE a.BookNum = b.BookNum"
Dim BListCommand As New OleDb.OleDbCommand(BListSelectQuery, cnndbFile)
Dim BListReader As OleDb.OleDbDataReader
BListReader = BListCommand.ExecuteReader()
Dim nCount As Integer
If BListReader.HasRows Then
ComboBox.Items.Add("Select Verse")
ComboBox.SelectedIndex = 0
Do While (BListReader.Read())
Dim Book, Chapter, Verse, ChapterVerse As String
Book = BListReader.GetValue(BListReader.GetOrdinal("BookStdName")).ToString
Chapter = BListReader.GetValue(BListReader.GetOrdinal("Chapter")).ToString
Verse = BListReader.GetValue(BListReader.GetOrdinal("Verse")).ToString
ChapterVerse = Book & " " & Chapter & ":" & Verse
ComboBox.Items.Add(ChapterVerse)
Loop
nBibleMax = nCount
BListReader.Close()
Else
'MsgBox("Error on BibleList")
'ProjDataErrorMsg &= "No bibles listed." & vbCrLf
End If
BListReader.Dispose()
cnndbFile.Close()
End Sub ' Fill Combo Box Book, Chapter, Verse
i need to get the chapter and verse... i dont know if there is any way... help...