Click to See Complete Forum and Search --> : Datacombo doubt
Sujatha
Dec 1st, 1999, 11:39 AM
I'm using Visual Basic 6.0(SP3). I bound it to a ADODB Recordset. Both ListField and BoundColumn were bound to two fields of the Recordset. Assume, there are more than 50 items in the list. If I type some characters in the DataCombo,the Matching Item not get scrolled. Also ,If I assign value for BoundText , the Correct Item is not appearing in the Text Portion of DataCombo. If there ars less than 50 items everything works fine. Is there any API function to solve this Problem? Thanks for any Help.
mocoo
Dec 27th, 1999, 04:29 PM
I've a weird problem too:
I bind the datacombo to a DataEnvironment command that returns a recodset (5 - 10 records in it).
ListField is bound to recordset!Description and BoundColumn is bound to recordset!ID_num.
The list fills oK, but when I ask what is the BoundText, I get the text (whatever is in the Description field) not the ID_num ????
How could I list a description, but use a number ID in a simple way? (I thought the datacombo should do it :(
Thanks.
Mocoo.
Sujatha
Dec 28th, 1999, 10:22 AM
When I bound it to a DataEnvironment Command object everything is working fine. I didn't meet a problem as you told.
hi_vijay
Feb 16th, 2000, 10:56 PM
You will have to put code in Change event track the keys pressed and set Listindex property of that combo box with that number
Vitani
May 23rd, 2005, 07:17 AM
5 years, and 3 service packs later, and I'm getting this bug now. There seems to be nothing on the internet about it, other than open-ended forum & newsgroup threads. Has anyone ever solved this riddle?
To recap - if you have >50 items in a bound DataCombo control, and you try to set the BoundText property to any item with an index above 50, it does not work (the BoundText = ""), it works fine for all indexes below 50.
my code is this:
' For reference, any rsToUSe that is passed to this method is a Private ADODB.Recordset on the Form with the DataCombo on it
Private Sub PopulateList(ByVal TableName As String, ByRef cmb As DataCombo, ByRef rsToUse As ADODB.Recordset, Optional ByVal ColumnToDisplay As String = "Description", Optional ByVal ColumnToStoreInTable As String = "Code", Optional ByVal OptionalSQL As String)
' This Sub fills a Record Set (rsToUSe) with the two selected columns (strColumnToDisplay and
' strColumnToStoreInTable) from a table (dbTable) and then uses the Record Set to populate a
' DataCombo box (cmbBox) with the values in the Table
Set rsToUse = New ADODB.Recordset
rsToUse.CursorLocation = adUseClient
rsToUse.Open "SELECT [" & ColumnToStoreInTable & "], [" & ColumnToDisplay & "] FROM [" & TableName & "] " & OptionalSQL, fmMain.conn, adOpenStatic, adLockReadOnly
Set cmb.RowSource = rsToUse
cmb.ListField = ColumnToDisplay
cmb.BoundColumn = ColumnToStoreInTable
' x is defined elsewhere
cmb.BoundText = x ' setting the BoundText reports no error if x is an item > index 50, it just remains ""
cmb.MatchEntry = dblExtendedMatching
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.