Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Format problem
Message
 
To
12/12/2001 03:43:20
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00590977
Message ID:
00593170
Views:
28
>>>Hi,
>>>
>>>Thank for your help and advise.
>>>BTW, how do I go about using a fixed font in my combobox problem
>>>since it is due to the font problem ? Which font is a fixed fonts ?
>>>
>>
>>Courrier
>
>Hi,
>
>As mentioned previously, if I want to programmtically
>bind an ADO recordset to a auto filled combo, I should be using
>data combo control.
>
>However, it don't seem to auto fill up the combo box with my
>data at all. I am using code insteads of the ADO control with part of
>my code shown below, please kindly advise and comment.
>
>
> Set cnn = New ADODB.Connection
> Set rs = New ADODB.Recordset
>
> ...
> ...
>
> cboDataCombo.ListField = "Vip"
> set cboDataCombo.RowSource = rs


Set the RowSource property before the ListField property like this:
Private Const mkCS As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Projets VB\NWIND.MDB;"

Private Sub Command1_Click()
Dim rstData As ADODB.Recordset

    Set rstData = New ADODB.Recordset
    rstData.Open "SELECT LastName FROM Employees", mkCS, adOpenStatic, adLockReadOnly
    Set DataCombo2.RowSource = rstData
    DataCombo2.ListField = "LastName"
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform